How to Insert META Description Tags in Wordpress
June 12th, 2006It is essential to include the META Description tag on all your webpages for better search engine indexing. But most blog platforms and client do not create such unique description tags for each article page.
Wordpress too does not create such META tags. META Description tags are inserted between the HEAD tags on the webpage. So how to create meta description tags for all your webpages which are customized for each page?
You need to edit the HEADER file in your blog template presentation. Then you need to add a META description tag.
It is easy to add meta description tag based on any custom text like
<meta name="description" content="any text you want">
or you can insert the blog description within the tags.
<meta name="description" content="<?php bloginfo('description'); ?>" >
or use this tag to get a short excerpt of your post into the description.
<meta name="description" content="<?php echo htmlentities(get_the_excerpt()); ?>" >
Now if you want to customize descriptions on specific pages like index page, single post pages, category pages or archives, you can place these codes between the conditional tags. “The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending on what conditions that page matches.”
Some common conditional tags are
The Main Page
is_home()
A Single Post Page
is_single()
A PAGE Page
is_page()
A Category Page
is_category()
Any Archive Page
is_archive()
Not so complex? suppose you do not want to include the same blog description on all pages, but choose to include short post excerpts on all single post pages to make it more targeted. You get this code.
<?php if (is_single()) { ?>
<meta name="description" content="<?php echo htmlentities(get_the_excerpt()); ?>" />
<?php } ?>
If you want a more automated means of doing the job, you can use several META tags wordpress plugins which can do this for you easily. But put those META tags in your Wordpress today.









Do you use a plug-in? If so, which one? And, are meta tags completely unassociated with the tags created by plug-ins like Ultimate Tag Warrior?
There is a lot of confusing reading to be found on the subject of meta tags. I keep reading that search engines completely ignore meta tags due to their misuse by spammers over the years.
Good contents
I tried to submit my site to MS Live Search engine. It generates me a meta name which I need to include in the index page of my site.
How can I do this? My blog site is WordPress and in my home directory I only see index.php
How can I insert the meta name like this:
this space is contains alphanumeric characters
Thanks.
Thanx for this wonderfull tip….
I was looking the same.. from long time…
Thank you so much, I’ve spent ages trying to get this to work with various plug-ins. One line of php was all it took. Thank you!
Thanks 4 sharing such a piece of Useful Information.
This was really helpful. 10x.