How to: Hide WordPress version

In order to secure your blog, is it a good thing to hide the meta version appearing within the <head> and </head> html tag of your blog. Since WP 2.5, the version is inserted automatically, and can’t be removed as easily at before. Except if you use that hack !

This hack isn’t hard to do at all. Just open the functions.php file from your theme and add the following line of code:

remove_action('wp_head', 'wp_generator');

On the above code, I just used the remove_action to remove the wp_generator() function, which prints out WP version. As that function will now not be executed, the WordPress version will not be visible from your source code, and potential hackers will never know which version you are using.

Related Posts

Related Posts

No related posts.

4 Responses

Sep 21 2011 06:51

Can I add that line code anywhere?

Mar 10 2012 11:24

I Added the code to my functions.php file. Now how can i assure that it is working ?I am using Alltuts theme by site5 .

May 04 2012 23:51

This example is useless… it only hides fraction… you can get WP version from links to css files and so on there are parts in links like ?ver=3.3.2

Jul 30 2012 12:54

Thanks… I will try it on my wp…

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox