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...
To mount WordPress files into an existing directory, you can follow these steps:Download WordPress: Visit the official WordPress website (wordpress.org) and download the latest version of WordPress. Extract WordPress files: Extract the downloaded WordPress.zip...
To update WordPress manually, follow these steps:Backup your WordPress website: Before making any updates, it&#39;s crucial to create a backup of your website. This ensures that in case anything goes wrong during the update process, you can restore your websit...