Remove WordPress Generator Tag

I am going to show you how to remove the WordPress generator tag by commenting out the code within the wp_head function.

Pros
– Removing the tag at it’s source can improve performance. You will not have to use a plugin to remove a tag after it has been generated by WordPress.

Cons
– The file that creates the generator tag can change when you upgrade WordPress to a different version. When the file is changed the call to create the function will not be commented out, which means you will have to go through this process again.

Step 1

Navigate to your WordPress installation folder and find the default-filters.php file (WordPress > wp-includes > default-filters.php).


Find the Actions section of the wp_head method.

Step 2


Comment out the code by placing // before the line. Save the file and you will no longer have the generator tag in your site’s source code.