Skip to main content

How to Remove WordPress Version Number

By default, you can easily check WordPress version of your website because of its footprints left somewhere. As a matter of fact, other people also can check that information if you are not hiding it. But if you are not running the most updated version of WordPress, it might cause security leak for your website. It is the best to always keep your website up-to-date and you no more have to care about WordPress version being public. However, if you have some reason to keep old version, we recommend you to remove WordPress version number on your site.

How to remove WordPress version number

There are many ways to get rid of the WordPress version number from your header. But there is only one correct way to do this.

Some sites will recommend that you open your header.php file and get rid of this code:

<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />

Or others will recommend that you open your functions.php and add the following function:

remove_action('wp_head', 'wp_generator');

But both of these ways are offering you an incomplete solution. These ways will simply remove the WordPress version number from your head area. So if someone views your website source, they will not be able to see the version.
But a smart hacker who knows about WordPress will simply go to your RSS Feeds, and they will find your version number there because neither of the above codes will remove that number.

In order for you to completely remove your WordPress version number from both your head file and RSS feeds, you will need to add the following function to your functions.php file:

function wpbeginner_remove_version() {
return ''; } add_filter('the_generator', 'wpbeginner_remove_version');

By adding this version, you will remove the WordPress version number from all different areas on your site. Above is the right way to remove WordPress Version number.

Related News

10 stupid-easy tips for a SEO friendly blog post

There are several criteria to evaluate a good blog post. SEO-friendly blog post is an...

How to choose a domain name smartly?

Choosing a domain is like picking the name for your brand. It will last for...

3 easy ways to check WordPress version you are using

Why need to check WordPress version? To make sure your site is always up-to-date, you...

Leave a reply