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

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

How to Remove a Blog's WordPress Version | eHow.com

By default the source code of your WordPress website displays the version number of the Reduce the chance of this happening by removing the version number from your Read More

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

WordPress Tip: Always Remove the WordPress Version Code

Doesn’t matter what the version number is. I see old attacks Well, I’ve tried all the above methods for removing traces of my WordPress version from public Read More

WordPress › Support » Remove - WordPress › Blog Tool

I found some info on removing Generator metaname from feeds. You can put all this in your Functions.php to hide generator metaname, hide WP version number, remove the Read More


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>