The Correct Way To Hide WordPress Version From The Source Code

hide wordpress version

We all know that WordPress security is necessary and you should take a few steps to secure your website. If you are using WordPress then you should know how to hide WordPress version.

It’s because when you install WordPress for the first time then it consists a code which tells the WordPress version you use on your website.

Do you know how to check WordPress version? Well, anyone can check it. But this information can be helpful for the hackers to reach out to your website.

You should hide WordPress version so that no one can create the backdoor to hack your website. WordPress is one the leading platforms and you should know the proper way to use it.

What People Provide You To Hide WordPress Version

First, let me give you an idea about the code which shows the WordPress version you use on your website. There is a meta tag in the header section. It consists the name=”generator” using which you can search it on the source code of any website.

<meta name=”generatorcontent=”WordPress 4.6.1” />

This code shows the WordPress version. It may vary with the website because there are many people who don’t update WordPress just after one day of latest release. They wait if there is any bug.

hide wordpress version

You may have noticed that people suggest you to remove this code from the header. They would provide you a line of the code to add in the “functions.php” file.

remove_action( ‘wp_head()’, ‘wp_generator’ );

Though this code would hide WordPress version from the source code of your website. But if someone is smart enough to search the RSS feeds of your website then the “generator” tag would be there.

And you don’t want to leave any vulnerability then you have to remove WordPress version perfectly from all the places. This is something you should do the protect your website.

What Should You Do

You have to create a function and use the WordPress filter and remove it. You just have to edit the functions.php file of your WordPress theme.

function blogginglove_wordpress_version(){
return ”;

Add this code and save it. Now you can check the source code of your website. You won’t find any “meta” tag showing the WordPress version.

Now, if you want to use the older version of WordPress then you can do that because no one would come to know about it.

There are many WordPress developers who add this code while developing the theme. If you are having a theme with this code enabled then you don’t need to worry about anything.

Just check the page source code and you will come to know whether your theme is hiding the WordPress version or not. If it does then congrats, you are safe.

Have You Ever Thought To Remove WordPress Version From The Source Code

You may have come across this concept but never took an eye. But, when you run a WordPress blog then you should do all the possible things to protect it.

And the best action is to backup your website and the database. It’s because if your website has been hacked then you can restore WordPress site from backup again.

If you take the decision to hide WordPress version then it means, you are taking one step further towards securing your website.

by Ravi Chahar

A WordPress Professional and the LinkedIn Influencer. A coder by passion and a blogger by choice. WordPress theme development is his forte. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, design issues and what not.

Get Free Updates Into Your Inbox

Learn Everything Just Like I Did


Leave a Reply

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