Remove WordPress Version Number from Head

a minute read

WordPress automatically adds its current Version number to the head section of the themes. If you view the source of a WordPress-based website, you may find out the WordPress version it is using.

Below given is the meta tag that carries that version information and can be spotted when you right-click and view source of a WordPress site:

<meta name="generator" content="WordPress 4.3.1" />
WordPress Version info inside the meta tag

This extra information about CMS version is added by WordPress itself in order to keep track of the sites that make use of it.

But for security sake, you may not want this particular info to show up in the source of your WordPress site, as it will simply let the people know what version of WordPress your site is making use of. Now, you can imagine about the goods and bads of it.

WordPress Action to remove version meta

We do have an action that may help us to turn-off adding of WordPress generator tag in the head section. Adding the below code in your theme’s functions.php and saving changes will remove that version meta info:

remove_action( 'wp_head', 'wp_generator' );

Hope you find this useful!

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

Related Posts:

WordPress functions wp_enqueue_script / wp_register_script and wp_enqueue_style / wp_register_style add additional version info in the end of the JavaScript and CSS files you link (include or add) using these functions. This version info is important to ensure...
We want to customize lots of things in our WordPress themes, and WordPress gallery style can be one important of those. At first, it may seem easy stuff, but actually it isn’t that easy. As a developer, you may think of customizing the look of WordPress galler...
You can learn how to start a WordPress site using the Internet as your primary teaching tool. WordPress is very easy to use, fortunately, even for dummies. Many an ebook can be found on this subject. You need woocommerce as an open-source e-commerce plugin tha...