For WordPress v2.4 I have introduced some changes to the way in which all of the generator tags present in the output from WordPress are generated.
The generator tags/comments were previously hard coded in the following items: Theme’s header.php, all of the feed generation files, the export generation process. I have now centralised the generation process into three functions in wp-includes/general-template.php: get_the_generator, the_generator and wp_generator. The new functions provide an array of filters to enable you to modify the generator output or remove it completely if you so wish. The standard WordPress xhtml generator tag is now generated on the wp_head hook rather than needing to be hard coded into the themes files – this does mean that themes with a generator tag in them will now have two but it does reduce the number of things a theme author need to remember to include in the theme files.
For example, if you are creating a HTML theme rather than an XHTML theme then you will want to add the following to your themes functions.php file which will ensure that the default generator tag output by WordPress on the wp_head hook is the HTML one:
function i_want_html_generator()
{
return 'html';
}
add_filter('wp_generator_type','i_want_html_generator');
Another use of the newly available filters is, for example, to enable you to hide the fact that your site is running WordPress or to mask the version of WordPress that you are running. In order to do this the new functions have a variety of filters available. As we have already seen there is a filter to enable you to determine the type of generator output in your theme, the other filters available are: the_generator, get_the_generator_$type where $type is the name of the specific generator type you want to filter/hide. You can hide all of the generators on your blog with one simple plugin containing the following code:
function i_want_no_generators()
{
return '';
}
add_filter('the_generator','i_want_no_generators');
If you want to read more about the reasons behind these changes then please see the related trac tickets, #4803 and #5085, or read the code itself in the changeset [6195].

[...] More information about the changes to the WordPress generator output and the new filters that are available to allow themes and plugins to affect the output can be read in this article: “Improving the WordPress Generator“ [...]
[...] This week, he shares about the changes on the database table prepare switch, changes to the WordPress generator tags, improvements in the MySQL functions via the $wpdb class, and new sanitization functions for [...]
[...] http://blog.ftwr.co.uk/archives/2007/10/06/improving-the-wordpress-generator/ [...]
[...] this, I make him a simple plugin he can upload based directly on what Peter Westwood documented on his blog. Easy as pie. Took me ten minutes. I slap it into a PHP file and send it [...]
If I remember correctly, you can also do:
remove_action('wp_head', 'the_generator');Not that it really matters.
@Jeremy: Indeed you can. The point behind the filter method is this also removes the generators from all the other places as well – like the feeds.
[...] to the world the version of Wordpress you are running, you greatly simplify the work of a hacker. Peter Westwood’s post documents how to suppress output of the Wordpress version number in feeds and blog posts. [...]
[...] to the world the version of Wordpress you are running, you greatly simplify the work of a hacker. Peter Westwood’s post documents how to suppress output of the Wordpress version number in feeds and blog posts. [...]
[...] della versione Wordpress che giri, il lavoro di un hacker è semplificato notevolmente. In un post Peter Westwood ha documentato come sopprimere informazione sulla versione di Wordpress nei feed e il blog. Ho [...]
[...] habe das Plugin bzw. den Quelltext von Peter Westwood kopiert. Der obige Text muss einfach in eine Text-Datei gespeichert werden. Der Name der Datei [...]