How to add a Meta Decsription field in WordPress post and pages



If you didn’t know, am running a Beta of my Blog Theme “standardStrap” here on my blog, and as part of the development i added a Meta Description field to make the site a bit more Search friendly. Meta description has not so much to do with SEO ranking these days, but for the readers to know what your post is about this field is very good.

The meta description field shows in Google search results like in the picture under here.  In this example i have not implemented this function yet, and you can see that is the description is more then 160 characters. 160 characters is best practice…

google-meta

I develop my theme to minimize the need of Plug-ins as they often include functions that i don’t want or badly compressed code that slow down my site. This little function is part of my theme now but i like to share the code and how to implement it. Its super fasts and Easy!

In your functions.php add the following code.

Next open your Header.php and add the following code under </title>

Wow, your done, it will look like this when you post.

meta-field

Leave a Reply

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