SEO for WordPress

WordPress is pretty well setup for SEO right out of the box. That being said, there are a few things you can do to make it more friendly to the search engines. I found this quick tip that makes SEO for your wordpress blog even better.

The instructions below will enable your wordpress blog title and meta description to become relevant to the on-page content. Instead of having the same title for each page of your blog, the title for each page will use the title of the post. And, the description will be a handful of words taken from the content of your post.

Here’s what you do:

In your theme’s directory, open the file “header.php.”
Replace the current title with:

<?php if(is_home()) { echo’<title>’; bloginfo(‘name’); wp_title();
echo’</title>’; } else { echo’<title>’; the_title(); echo ‘ | ‘; bloginfo(‘name’);
echo ‘</title>’; } ?>

Under that, add:

<meta name="description" content="<?php if ( is_single() ) {

single_post_title(”, true);

} else {

bloginfo(‘name’); echo " – "; bloginfo(‘description’);

}

?>" />

 

The first code change will put the blog name in the title, and use the post title and blog name as the title on the post pages.

The second part will put the blog name and description (found in the Options / General section in the Tagline field) on the home page (for the meta description), and put the post title as the description on the post pages.

I hope that helps some of you. I got this code from the “SEO Scoop” blog here.

Comments are closed.