Tech-Evangelist

Technical Articles, Musings and Opinions from Tech-Evangelist

  • Home
  • About
  • Guidelines
Previous article: Editing Files Online with FileZilla
Next article: How to Backup FileZilla Settings

How to Remove Useless Meta Tags from WordPress

May 9, 2009 By Doogie - Copyright - All Rights Reserved

The XHTML code generated by WordPress includes a few useless meta tags that can easily be removed. The following tutorial explains how to do this.

The purpose for meta tags is to provide useful information to spiders and search engines. Meta tags do not display on a web page, but do display in the HTML or XHTML code. Many meta tags are obsolete or do not serve any real useful purpose. You can remove these meta tags from the code for your WordPress pages.

Why would you want to remove them? Because they serve no useful purpose. Any browser code that does not serve a purpose should be removed. Unnecessary code slows down page server processing, download and rendering times. While each individual meta tag may only slow final rendering by milliseconds, there is a cumulative effect with web page performance, which means that each useless segment of code or unnecessary function call adds time to the final rendering of a page. If you want peak performance from your web pages, optimize the code by removing junk that serves no useful purpose.

The first meta tag to remove is the WordPress “generator” tag that displays the version number. While it does make it easy to determine the WordPress version number for your blog, it may also give a hacker useful information to hack your blog. You are much better off when you keep the WordPress version number a mystery to those with malicious intent. All WordPress security scanning plugins recommend that you remove this tag.

When you use View > Source in your browser, the generator tag looks like this:

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

The code to generate this tag is found in the header.php script in your theme. Look for a line of code near the top of the script that looks like this. When you find it, delete it.

<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />

There are a few plugins that will remove this entry from the head section of your pages, but I have not tested any of them. If you know anything about PHP, it is easier to just remove the code.

Two other useless lines of code include the Really Simple Discovery tag and the Windows Live Writer tag. Really Simple Discovery was an method used in the early days of blogging to share information about the blog with client. Today, it does not do anything useful. According to the Live.com web site, “Windows Live Writer is a desktop application that makes it easier to compose compelling blog posts using Windows Live Spaces or your current blog service.” Never heard of Windows Live Spaces? Neither have I. Unless you know what it is and are using it, the tag is useless and should be removed.

These tags look like the following when using View > Source in your browser.

<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://tblog.in/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://tblog.in/wp-includes/wlwmanifest.xml" /> 

You will not find the PHP code that generates these tags in your theme scripts, but you can suppress their display by adding the following lines of code to the functions.php file found in your theme directory. You can add these function calls anywhere in the functions.php script. I usually add them at the top.

remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');

Make sure that you copy the header.php file and the functions.php file to your web site and check the pages. These useless meta tags should now be gone.

Filed Under: WordPress Tutorials

Comments

  1. Whacko Jacko says

    June 19, 2009 at 6:21 pm

    Thanks a lot for those two pieces of code, the others I found on the web doesn’t work. As for removing the wordpress generator tag, no plug ins are necessary. Just add this to functions.php:

    remove_action(‘wp_head’, ‘wp_generator’);

  2. Sugihartono says

    January 29, 2012 at 12:01 pm

    Thanks for this tutorial. Simple but useful

Categories

  • Affiliate Marketing
  • CSS Tutorials
  • FileZilla Tutorials
  • Home Theater
  • Internet Marketing
  • Internet Technology
  • Kindle Tips
  • MySQL Tutorials
  • Online Auction Tips
  • Paint Shop Pro Tutorials
  • PHP Tutorials
  • Tech News
  • Thunderbird Tutorials
  • Video Production
  • Web Site Development
  • WordPress Tutorials
follow me on Twitter
Content and images are copyrighted by Tech-Evangelist.com and others

© 2021 Tech-Evangelist.com - All Rights Reserved
Posted code samples are free to use. Do not reproduce or republish articles or content on another web site.

Privacy Policy : Terms of Use