Submit ClassicPress to W3Techs

This is correct :+1:

There are other ways to detect ClassicPress such as the presence or content of certain files, but scanners need to implement these too, which I think hasn’t happened yet for the most part.

You may not want to do this if the generator tag already exists, since this will duplicate it.

Sure, this works for me:

<?php

if ( ! defined( 'ABSPATH' ) ) return;

function cp_restore_default_generator( $gen, $type ) {
    global $wp_version;

    $esc_wp_version = esc_attr( $wp_version );
    $esc_cp_version = esc_attr( classicpress_version_short() );

    return "<meta name=\"generator\" content=\"WordPress $esc_wp_version (compatible; ClassicPress $esc_cp_version)\">";
}
add_filter( 'get_the_generator_html', 'cp_restore_default_generator', 9999, 2 );
add_filter( 'get_the_generator_xhtml', 'cp_restore_default_generator', 9999, 2 );

We will also be releasing our own stats for number of sites, hopefully fairly soon. These should be much more accurate.

5 Likes