WordPress.org

Ready to get started?Download WordPress

Forums

Removing Meta Generator WordPress (8 posts)

  1. horizon70s
    Member
    Posted 5 years ago #

    Hello,

    I wanted to remove from my site:

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

    I saw this thread below:

    http://wordpress.org/support/topic/164884?replies=16

    I get this after adding to my functions.php file:

    Fatal error: Call to undefined function remove_action() in /pathto/wp-includes/functions.php on line 25

    So my question is 2-fold:

    1) Instead of adding a remove function into functions.php - doesn't it make more sense to remove the code that generates the generator in the first place?

    2) If this is the best way, does anyone have any idea why I'm getting that fatal error?

    Thanks

  2. mrmist
    Forum Janitor
    Posted 5 years ago #

    You need to be putting the

    remove_action('wp_head', 'wp_generator');

    Into your theme's function.php, not the core functions.php.

  3. Dgold
    Member
    Posted 5 years ago #

    Good idea to remove it. If you display the "Generated by WordPress version #" in your source code then it's easier for someone to find your site (like a hacker) who is searching for WP sites of that particular version to exploit.

    Very frustrating, self-aggrandizing, and unnecessarily risky for WP to tuck this generator code where it is harder to remove than it used to be. This 'feature' takes away your privacy as an independent website designer to display only-what-you-want. It used to be in the theme's header.php not in the core code, so you only had to delete it from your theme. Now the 'generated by WordPress version #' appears even if your theme doesn't have it. You have to use the function.php method to hide it. Bummer.

    Probably the worst and most risky feature of WordPress.

  4. horizon70s
    Member
    Posted 5 years ago #

    Into your theme's function.php, not the core functions.php.

    Yup, I'm an idiot. Thanks

    I agree with you Dgold.

  5. satoridork
    Member
    Posted 5 years ago #

    Where is the "best" place to insert the code into the theme's function.php?

  6. whooami
    Member
    Posted 5 years ago #

    if you want to be safe, put it right before the closing ?>

  7. mhakim
    Member
    Posted 4 years ago #

    not working on 2.8.4 ?? i've tried it.. it's still shown. :(

  8. Kongtechnology
    Member
    Posted 4 years ago #

    Instead of removing the tag completely, any idea how to edit it slightly... For example, instead of showing the usual:

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

    I want to show:

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

    Yes, remove the version info only. Any idea how to do this?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic