Removing the WordPress Version Number


Sponsored Links






How To Removing WordPress Version NumberDid you know that? By default, WordPress provides your WordPress version in your feeds. If you peak under the hood and look at the source code for any of your WordPress feeds. Near the top of the file, you will see that WordPress includes its version number declared via elements:

http://wordpress.org/?v=2.9.2

It serves as a slight security risk by enabling attackers to target any specific security holes that may be present in your particular version of WordPress. I will show you how to remove WordPress Version Number on feeds and your theme’s as well. What should we do to remove this information from your site’s feeds, add this tiny function on your functions.php

<?php
function killVersion() { return ''; }
// For Feeds
add_filter('the_generator','killVersion');

// For Theme Header
remove_action('wp_head', 'wp_generator');
?>

Or you can use another method below

// remove version info from head and feeds
function complete_version_removal() {
	return '';
}
add_filter('the_generator', 'complete_version_removal');

Second code almost the same with the first code, but using add_filter and not remove_action. I think on new version WordPress, second code is better

And done, now, you WordPress Version Number has been hidden…

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

WP Tutorial: Remove admin name in comments class

Batovasan, create nicely WordPress Tutorial. The reason create this tutorial is Small Security Hole on WordPress. Like we all know by default, when the blog admin left a comment on his blog, WordPress use the name in the comment css … Read More

The Best Way to Insert Custom Content into Feeds

My Another Favorite featured in WordPress is easy to tweak it out. And WordPress good support on Feed. Sometime we need to insert custom content into our WordPress Feeds right? On this post I will show you how to Insert … Read More

How To Set HTML editor as the default on WordPress

Like we all know, WordPress has two editor mode, Visual and HTML. Now using WordPress add_filter() we can force WordPress to set HTML Editor as default WordPress Post editor. Let's do it, first open your functions.php your current themes and … Read More

Remove nofollow attributes from comment text

WordPress added nofollow attributes on comment text url, this is bad for some commeter that needed some backlinks, if you want remove nofollow attributes from comment text in your WordPress site is easely, all need to do just added some … Read More

Post Thumbnail on RSS Feed

Jeff Starr give nice tricks how To Added Post Tumbnail in our RSS Feed, and I will show you on today wordpress tips. This code only need tiny hack, we put some code in our functions.php and the code will … Read More

The Right Way to Remove WordPress Version Number

In order for you to completely remove your WordPress version number from both your head file Removing the generator code has nothing to do with security, frankly. If read more

Source: http://www.wpbeginner.com/wp-tutorials/the-right-way-to-remove-wordpress-version-number/

How to Remove the WordPress Version Number (The Right Way

While there are indeed valid reasons for removing this important WordPress hook, removing the version number from your source code is not one of them. read more

Source: http://digwp.com/2009/07/remove-wordpress-version-number/

Removing the WordPress Version Number / WordPress Tricks & Tips

Did you know that? By default, WordPress provides your WordPress version in your feeds. If you peak under the hood and look at the source code for any of your read more

Source: http://wptricks.net/removing-the-wordpress-version-number/

How to Remove the WordPress Version Number « MalarVizhi

Don’t display your WordPress version number publicly Many WordPress valid reasons for removing this important WordPress hook, removing the version number read more

Source: http://malarvizhik.wordpress.com/2010/07/28/how-to-remove-the-wordpress-version-number/

Removing WordPress Generator Version and Other Code From the Head

The problem with this is broadcasting the version number of WordPress is a Leave a reply to Removing WordPress Generator Version and Other Code From the Head read more

Source: http://www.google-adsense-templates.co.uk/removing-wordpress-generator-version-and-other-code-from-the-head.html


12 Responses to Removing the WordPress Version Number

  1. salsabel says:

    It doesn’t work anymore..

  2. Sauna says:

    Seems to work for me. Maybe you did something wrong salsabel?

  3. It doesn’t work anymore..

  4. Frank P says:

    Does anyone have a link that works?

    • Jim says:

      Just put this line in the functions.php inside your theme folder.

      remove_action(‘wp_head’, ‘wp_generator’);

      just before the ? > at the end

  5. helpin says:

    Some plugins like login-with-ajax and wiki are showing the version number in source code. How do I remove them?

  6. IndeHost says:

    i’ve tried this function but it’s doesn’t work for enqueue script. any suggest?

  7. Not working anymore for WP 3.1

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>