Last updated on September 13, 2023

Remove Version Number

Don’t know where to add this snippet? Read our guide: How to add code snippets.

Hide the WordPress version number.

By default, WordPress includes its version number in the page source code, which can potentially expose your website to security vulnerabilities. It adds a generator meta tag in the <head> of your site, like so:

<meta name="generator" content="WordPress 6.1.1" />

To remove this generator meta tag in order to clean up your site’s code and provide an extra bit of security through obscurity, you can use the following snippet:

add_filter('the_generator', '__return_empty_string');
Last updated on September 13, 2023. Originally posted on April 30, 2023.

Leave a Reply

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