Subscribe in a reader - Subscribe via Email - 1897 Subscribers and Counting!!!

World of information, opinions, cricket and technology.

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

Technorati Tags: , , , , How-to




RSS Feed

1897 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:


You Should Also Check Out These Posts:


25 Responses to “How to Remove Wordpress Meta Generator tag”

  1. This is great, thank you

  2. 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.

    Sires last blog post..A Twitter Service You’d Be Crazy To Miss Out On

  3. 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.

    Lyndis last blog post..Widgets Reset

  4. 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.

    Pallabs last blog post..F.lux – Calibrate Your Display to the Time of the Day

  5. 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 :)

    George Serradinhos last blog post..Funny – iBoob from Apple

  6. Ricky says:

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

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

    Tech @ InkAPoints last blog post..Google Translate’s Security Breach

  8. dug says:

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

    dugs last blog post..untitled.jpg

  9. 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

  10. Atul says:

    I be soon get rid of it

    Atuls last blog post..Different Stages of Love

  11. [...] How to avoid Hotlinking of file and images using .htaccess hack [...]

  12. [...] turned off, ask yours if this is red. 5. That the Wordpress ID metatag has been removed, learn how to remove it here. 6. The Admin user has been removed (Add your own user, grant it “admin” rights and [...]

Leave a Reply





CommentLuv Enabled