How to Insert META Description Tags in WordPress

It 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

A Single Post Page


A Category Page

Any Archive Page

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.


  1. Ron Pemberton says:

    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.

  2. khoj4u says:

    Good contents

  3. carlo dela cruz says:

    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


  4. Sonia says:

    Thanx for this wonderfull tip….
    I was looking the same.. from long time…

  5. Oscar TG says:

    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!

  6. Johny Deep says:

    This was really helpful. 10x.

  7. aNAND says:

    Thanks for the code. That works :)

  8. ashy4081 says:

    thx for this code hope it will work i ll try out this today

  9. koppit says:

    Just wanted to point this one out: if you want a description for only the landing page, you can use this code:

  10. Chuck says:

    Good method to add META description tag to each script.

    Thank muck.

  11. Berry Oaklan says:

    Just know the easy way to seperate meta content to each page.
    Thanks much,

  12. Don says:

    Thank for code.

  13. Dannie Tindel says:

    Exceptional site, where did you come up with the info in this piece of content? I’m pleased I found it though, ill be checking back soon to see what other articles you have.

  14. oladipupo says:

    pleas i need ways to insert meta tags on my site

  15. Ngoc Thuy Shop says:

    Do you know how to insert meta tags for blog hosted on WordPress.COM?

  16. Freehandyman says:

    Thanks for the helpful tips and advice! I’ll try to implement them immediately.

  17. Denver Chiropractor says:

    Very helpful article thank you very much!

  18. barnastmalistan says:

    thanks for info and code, it works.

  19. benjie says:

    thank you for this. very very helpful.

  20. Silvani BLOG says:

    Thanks for sharing the tips. At last i now understand the work of meta description and meta tags plus how to impliment them.

  21. Jackie says:

    People who understand WordPress code seem to get this. However, I don’t understand how, why and where to insert Meta Descriptions — nor how to check if they came through correctly. Could you help with that? Thank you!

  22. Varinder Pal Singh says:

    Thanks for the nice tutorial.

  23. Nisha Advani says:

    Thanks! , though am using wordpress which has all in one seo for the description this could be useful for my non-wordpress websites!!

    • Zion Amal Rafeeq says:

      Hey Nisha.
      WordPress is the Best Platform for Blogging and happy to hear that more users are bouncing into WP.

  24. Pratik says:

    meta tags used to be more helpful, providing important information to the Internet browser. However, Google does no longer use the meta keyword and Covering all the reasons meta tags are and aren’t important to search engines though.

  25. MineshRai says:

    I use Thesis Framework, it has in-build option for this, its nice.

  26. Zion Amal Rafeeq says:

    Thanks a lot for sharing :)
    I’m new to WordPress and I’m pretty sure I’ll be back to QuickOnlineTips for more.

Leave a Reply

Your email address will not be published. Required fields are marked *