| OR |
« The Smart Easy Road From PowerPoint To YouTube | Customizing Google Docs Form For Email Validation Using Free jQuery Script »
|
WordPress is popular because primarily it is easy to use. Free WordPress templates are available in abundance, so are the widest varieties of plug-ins which too are free to use.
Given all that, it is a bit surprising that WordPress doesn’t give the options to have separate title and description meta tags for the posts and pages you create.
Since these 2 tags are important considerations for search engine optimization, you have to therefore look for workarounds to be able to easily embed the title and description meta tags in both WordPress posts and pages.
Fortunately, this is not difficult to do. The video below shows you how to do it, followed by step-by-step details.
Embedding Title Meta Tag In WordPress Posts & Pages
To do this we will install the popular WordPress plugin, All in One SEO Pack.
- Go to this page, and download the plugin zip file. Unzip, and then FTP-upload the entire plugin folder (NOT just the individual php files) to your web-server directory, /wp-content/plugins/.
You can also use WordPress’ in-built plug-in search facility in the Install Plugins page to locate this plugin, and then automatically install it in your blog. This is easy to do, and you can avoid the above lengthy steps.
- Open your WordPress blog’s admin panel, the Dashboard, in your browser, and locate the plug-in in the plug-ins menu.
- Configure the plug-in options as necessary, and activate/enable the plug-in.
If you now want to add a new post or a page, WordPress will present you the All in One SEO Pack option of including the title and the description for that post or page. See the image below.
Since what you write here will be the page title of the post/page, keep it short but don’t forget to include the relevant key-phrase in it. Remember, you also have the title of the post/page above, which will now appear as the heading of the article you write.
All in One SEO Pack provides the option of description meta tag as well, but in my experience this doesn’t work. Why? I don’t know.
So you need to find out some other means to do it.
Embedding Description Meta Tag In WordPress Posts
Let us look at some of the options here, and their pros and cons:
- The easiest way out is putting the following piece of code in the header area (‘header.php’ file).
<meta name=”description” content=”<?php bloginfo(‘description’); ?>” />
The problem is that this code mentions the same description for all the posts and pages. And that description is usually nothing but the Tagline of your blog in the Admin > Settings > General page. Perhaps you don’t want this as meta description for your blog posts.
- A viable option is to use the excerpt of the post you write in the description meta tag. The following image illustrates it. In this case, the code in the header area for the description meta tag will change to:
<meta name=”description” content=”<?php the_excerpt(); ?>” />
This works pretty well but there still remains a problem. What happens in many cases is that when you look at the HTML source code of the post, you’ll see a pair of <p> tag appearing in the description meta tag as shown under:
<meta name=”description” content=”<p>blah, blah, blah…</p>” />
- To overcome this problem yet another change is needed in the code. The final piece of code is given below. Embed it in the header area, and from now on whatever you mention as the excerpt for a post will appear as the description for that post page.
<meta name=”description” content=”<?php echo get_the_excerpt(); ?>” />
Embedding Description Meta Tag In WordPress Page
Okay, the posts in WordPress will have the description meta tag as explained above. What about the pages? Usually, WordPress doesn’t allow the excerpt box for the pages even though both the posts and the pages will ultimately reside in the same database table.
However, not all hopes are lost. If you are using the latest release of WordPress, include the following piece of code in the file, functions.php. For more on this, go here.
add_action( 'admin_menu', 'mf_add_page_excerpt_box' );
function mf_add_page_excerpt_box() {
add_meta_box( 'mf_page_excerpt', __( 'Excerpt' ), 'mf_page_excerpt_box', 'page', 'normal', 'high' );
}
function mf_page_excerpt_box() {
global $post;
$message = __( 'Excerpts are optional hand-crafted summaries of your content. You can use them in your template' );
print < <<div class="inside">
<textarea rows="1" cols="40" name="excerpt" tabindex="3" id="excerpt">{$post->post_excerpt}</textarea>
<p>{$message}</p>
</div>
EOF;
}
Conclusion
WordPress says that code is poetry. Indeed it is so for, as you can see above, it is possible to do quite a lot when you know how to do coding, or at the least how to use codes that are already freely available. I belong to the second category, and so far I’ve immensely benefited by using WordPress.
One of that would certainly be the ability to embed the title and description meta tags in my posts and pages.
This article of May 3rd, 2010 is authored by Partha Bhattacharya, who runs this website. Partha also creates video-based e-learning course for clients, and when time permits, writes guest articles for selected sites.
4 Comments
Trackbacks/Pingbacks
- Tweets that mention Title & Description Meta Tags In All WordPress Posts & Pages -- Topsy.com - [...] This post was mentioned on Twitter by Partha Bhattacharya. Partha Bhattacharya said: VIDEO: How To Embed Title & Description ...
- Tweets that mention Title & Description Meta Tags In All WordPress Posts & Pages -- Topsy.com - [...] This post was mentioned on Twitter by Partha Bhattacharya. Partha Bhattacharya said: VIDEO: How To Embed Title & Description ...









Video Marketing is just the same with other forms of advertising, you need to capture the audience to make a sale*`;
In relation to WordPress and WordPress plugins. We can offer a really interesting viral traffic plugin that will for sure assist this site increase the traffic. It makes use of the Facebook Like and Share buttons but in a way that you will be very impressed by. Our plug-in gently pushes predefined text to the users of the website so that they will Like or Share your site much frequently than with any other method. You should still use the normal Like/Share buttons by your pages). This method will allow visitors for example recommend your index page to all their Facebook pals which a portion of should visit and virally increase traffic to your webpage. You can adjust the plugin in many ways so it suits you. If you visit the ilikeviral.com webpage, you can see how it functions. So if you want more visits and viral increase in traffic, come and see for your self. The affiliate program is also very interesting so you should also check that out even if you think the plugin is not for you. Thanks
these days, video conferencing seems to be one of the most effective ways to promote products`:`
10x a lot man.. weird that wordpress doesent
have that piece of code aka
<meta name="description" content="” />
in the info page.. thanks