WordPress.org

Forums

WP Remove Generator Meta Tag
Generator info is still generated on all pages... (5 posts)

  1. LJ
    Member
    Posted 4 years ago #

    I've installed this plugin and activated it, but the following line is still generated throughout my whole site:

    <meta name="generator" content="WordPress 3.0.1" /> <!-- leave this for stats -->

    I'm using the latest version (of the plugin). There don't appear to be any back-end options. Is there anything else I need to do to make this plugin work?

    Thanks in advance,

    Lee C

  2. Adam Harley (Kawauso)
    Member
    Posted 4 years ago #

    Have a look in your theme's header.php, this plugin only removes automated generator tags.

  3. LJ
    Member
    Posted 4 years ago #

    Thanks for the tip. It had been hard-coded in the theme header.php, just removed it. However, last night I had to deactivate all plugins as a random 500 error occurred overnight, it's fixed now but I'm unable to reactivate this plugin. When I try to I receive this error message:

    Fatal error: Cannot redeclare cr_remove_generator_footer_code() (previously declared in /**path removed**/auto-copyright/autocopyright.php:185) in /**path removed**/remove-generator-tag-for-wordpress/wp-remove-generator-meta.php on line 49

    Script execution halted: Cannot redeclare cr_remove_generator_footer_code() (previously declared in /**path removed**/auto-copyright/autocopyright.php:185) — 64

    Could be wrong but seems to be a random incompatibility with the Auto Copyright plugin. Bizarre thing is both had been running simultaneously for months with no issues (ftr I narrowed last night's 500 error down to the Platinum SEO plugin, it's been resolved so there's no question this issue is separate from last nights).

    Any ideas?

    Thanks again,

    Lee C

  4. Adam Harley (Kawauso)
    Member
    Posted 4 years ago #

    No idea why this plugin would be conflicting, there's really very little to it. For reference, all you actually need from it is:
    remove_action('wp_head', 'wp_generator');

    You can put that in your theme's functions.php and it would work equally as well really.

  5. LJ
    Member
    Posted 4 years ago #

    Think I fixed it. The error claims "cr_remove_generator_footer_code()" is the cause of it, so I had a look at the code for both plugins and at the bottom they both contain an identical piece of code (with the only difference being the name of the plugin):

    add_action('wp_footer', 'cr_remove_generator_footer_code');
    
    function cr_remove_generator_footer_code() {
    	echo "<!--  WP Remove Generator Meta Tag by Christopher Ross  - http://thisismyurl.com  -->";
    }

    Am I right in thinking this code is intended to remove - in this example - "WP Remove Generator Meta Tag by Christopher Ross - http://thisismyurl.com" from the footer of the site? Would it not make more sense to just not include it at all? I removed the above block of code, saved the file then managed to successfully activate the plugin.

    This issue also implies that trying to activate any future plugins containing this block of code (substituting plugin/author details) would also be unusable, so just to be safe I've taken your advice and placed the "remove_action('wp_head', 'wp_generator');" variable in the functions.php file of the theme and it works perfectly.

    Anyway, thanks for your input Adam :-) And I guess this is now resolved, so if anyone else experiences this issue, either remove the block of code in this post or simply add the

    remove_action('wp_head', 'wp_generator');

    to your themes functions.php file.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic