WordCamp Chicago

I’m speaking at WordCamp Chicago this weekend at the Chicago Mart Plaza. My session is titled Beginners Plugin Development and it will be an introduction to writing a WordPress plugin. WordCamp ChicagoYou can attend my session on Sunday, June 6th at 11:30am 11:15am in the Developers Track.

WordCamp Chicago has an exciting line-up of speakers and I’m looking forward to meeting with Chicagoland WordPress people and reconnecting with some folks I met at WordCamp San Francisco. WordCamps are all about networking, so make it a plan to attend all the parties and hit me up if you see me.

How to Tweak the WordPress Generator Meta Tag

WordPress adds a generator meta tag to the head element of every page that includes the version of WordPress you are using. Many people have debated the need for this and recommend removing it especially if you haven’t been upgrading WordPress regularly. A crawler can easily scan this info and look for sites that are running an older version of WordPress with a known exploit. You can add the following code to your theme’s function.php file or in a plugin.

Tweak the WordPress Generator Meta Tag

The following code will remove the version number from the meta tag:

function devmnd_tweak_generator( $generator ) {
        return str_replace( ' ' . get_bloginfo( 'version' ), '', $generator );
}
add_filter( 'the_generator', 'devmnd_tweak_generator' );

Before: <meta name="generator" content="WordPress 3.0-RC1-15112" />
After: <meta name="generator" content="WordPress" />

You can even add your own custom version number in the generator meta tag:

return str_replace( get_bloginfo( 'version' ), '4.0', $generator );

Remove the WordPress Generator Meta Tag:

if ( function_exists( 'wp_generator' ) ) {
        remove_action( 'wp_head', 'wp_generator' );
}