• Blogging
  • Freebies
  • Freeware
  • How-To
  • Make Money Online
  • Mobile
  • Home >> How-To >> How to Remove WordPress Meta Generator tag

    How to Remove WordPress Meta Generator tag


    I was reading an excellent post How to Stop Your WordPress Blog Getting Hacked. In that, the author has listed out different ways on how you can stop your WordPress Blog getting hacked.

    The second point in that post is to “Remove Meta Generator Tag”. This tag reveals the WordPress Version you are using. This is the reason to remove that tag.

    As instructed, I headed to header.php of my current theme and looked for the following line to remove it.

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

    I was surprised to see that line was not there but, it was getting generated when i view the source of my Blog.

    I then found a way to Remove WordPress Meta Generator tag.

    If you look the contents of header.php carefully, you will find a function call wp_head() just before tag. This is the function which is adding WordPress Meta Generator Tag.

    Our aim is to remove that tag from getting generated by wp_head() function.

    Following steps are to remove meta generator tag in wordpress:-

    1. Login into your wordpress as administrator privilege
    2. Go to Appearance -> Editor and click on the file functions.php
    3. Add this line before the line with ?> (make sure you are not adding it in any function) and click Update
    4. remove_action(’wp_head’, ‘wp_generator’);
    5. If you don’t find functions.php, then you need to create one with the content below and upload to your theme folder:-
    6. <?php remove_action(’wp_head’, ‘wp_generator’); ?>
    7. Save the file.
    8. Clear the cache if you using any caching plugin, Load your blog and check the source code.

    I hope the above steps helped you to remove WordPress Meta Generator Tag.

    You may want to read more WordPress tweaks and hacks:

    How to Beautify Code samples in your post using Syntax Highlighter

    How to implement Threaded Comments in WordPress Themes

    How to Add categories to Nav Bar

    How to add Comment Link in Single Post – WordPress

    How to Add WordPress pages to Nav Bar

    IMPORTANT: This blog welcomes Guest Bloggers, Writers to also contribute by writing Guest Posts and also Make Money!. Check out our Revenue Sharing Program
    1924 readers are already subscribed to this blog! Why don't you be one of them? Subscribe to this blog via your favorite RSS feed reader or by entering your email address on the form below:





    26 Comments

    1. Sire says:

      Hey Nihar, I read the very same post. It was pretty good wasn’t it? I followed several of the steps and will get to some of the other ones later.

    2. Lyndi says:

      I do not have the WP version showing in my code but I also do not have the code you mentioned in my functions.php. Somehow I managed to get rid of this in some other way. My problem is that I just cannot remember how I did it. Strange but true.

    3. Pallab says:

      Thanks a lot for writing this. I was aware of this, but being as lazy as I am..I just kept putting if off. Getting rid of that tag right now.

      I guess being hacked once didn’t teach me a lesson.

    4. Hi there,

      thanks for the information. I know this is off topic, but I have given you an award. Please go and see what award you have received from me.

      Thanks again 🙂

    5. Ricky says:

      @Nihar
      You always come up with something new.i didnt know about this thing.I should get rid of this code asap.

    6. Tech @ InkAPoint says:

      Well I am using a plugin for this thing. I know this method but it is not working always.

    7. dug says:

      i love how easy it is to alter wordpress with a few simple clicks. thanks for being so helpful.

    8. Used Tires says:

      It helps to keep away the amateur hackers, who may be using the version number for a simple hack…. but ultimately…. if a good hacker comes along… this modification won’t stop them. I am just saying… because I am now in my 3rd year at College for Software Engineering, and I learned alot from my professors, not about hacking… but in regards that no system is ever 100% secure. I mean this comment in a good way.

      Till then,

      Jean

    9. Atul says:

      I be soon get rid of it

    10. mirza says:

      very effective solution

    Leave a Reply

    page counter
    NiharsWorld on Twitter NiharsWorld on Facebook NiharsWorld RSS Feed