subscribe

You can update this text in your control panel, under Theme Options. Nam massa. Ut tempor augue non sapien lobortis aliquam. Maecenas.

Meta Title Tags for Wordpress

November 10th, 2009

All-In-One SEO is a great plugin for Wordpress and handles all your SEO needs. However, Facebook requires an additional meta tag which All-In-One doesn’t handle, the meta title tag. However, there is an easy way to add this tag in Wordpress, using the built in function wp_title.

The code looks like this, just add it into your header.php file:

<meta name=”title” content=”<?php wp_title(”,true,”); ?>”>

The only problem is that the homepage will be blank, fix it like this:

<?php
if (is_front_page()) {
echo ‘<meta name=”title” content=”BLOG TITLE” />’;
} else {
echo ‘<meta name=”title” content=”‘;
wp_title(”,true,”);
echo ‘” />’;
}
?>

Here is a link to the full reference for wp_title. Keep in mind this displays the same thing as using the_title within the loop, it doesn’t display the full page title, so if you’re changing the title with All In One SEO for example to include category, blog title, etc. this won’t be reflected here, which isn’t necessarily a bad thing.

Enjoy your titles!

Tags: , , , ,

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.

Spam protection by WP Captcha-Free