Enabling Individual Meta Tags on Your WordPress Blog

Yesterday, one of my friends put forward a doubt. She wanted to have individual Meta description tags for her WordPress self-hosted blog. There is an all-in-one SEO plugin that helps in it, but her description says she couldn't get it to work. Well, here is what you need to do to manually enable the Meta descriptions on your WordPress blog.

First, go to the theme editor, and look for the header file (which would be named header.php).

Now, simply insert the following PHP code right before the </head> tag.

<?php if (is_home()) { ?>
<meta name="robots" content="index, follow" />
<meta name="description" content="Enter the description for the blog home page here." />
<meta name="keywords" content="Generic keywords for the entire blog here." />
<?php } ?>
<?php if (is_single()) { ?>
<meta name="robots" content="index, follow" />
<meta name="description" content="This page contains details of:<?php wp_title('',true); ?>" />
<?php } ?>
<?php if (is_archive()) { ?>
<meta name="robots" content="noindex, follow" />
<meta name="description" content="This page is of the topic:<?php wp_title('',true); ?>" />
<?php } ?>
<?php if (is_page()) { ?>
<meta name="robots" content="index, follow" />
<meta name="description" content="This is a page about:<?php wp_title('',true); ?>" />
<?php } ?>

Edit the descriptions to match your blog.

That's it. You should now see individual Meta tags and descriptions for your pages. The robots Meta tag is completely optional and only if you don't want your category and tag pages be indexed in search engines, use the noindex attribute. Otherwise, leave it out.

Here is a related post on individual Meta descriptions on a Blogger blog.
You have read this article Blogging Tips with the title Enabling Individual Meta Tags on Your WordPress Blog. You can bookmark this page URL http://neurotica-exotica.blogspot.com/2009/02/enabling-individual-meta-tags-on-your.html. Thanks!

1 comment for "Enabling Individual Meta Tags on Your WordPress Blog"

  1. WordPress is the content management system for millions of websites all over the world. Part of the appeal of WordPress is that even those with no experience can customize a WordPress site and add new features with little effort codex wordpress theme

    ReplyDelete