I like Wordpress. I really do. At times I think it’s annoying, bloated, and the spawn of Satan - but I really do like it for heavy blog based sites. However, I’ve run into just about every damn problem with getting my Wordpress blogs all set for Google.
The main issue I’ve had is having posts end up in the supplemental index. Quite frankly, it sucks, so I’ve ended up reading far too many tutorials, guides, and forum posts on the subject.
So now it’s time to put down everything in one place (post) so I have a handy reference, and hopefully it can help out anyone who stumbles across this blog.
So let’s start off with a fresh WP theme, and tweak it so that you have a great shot at avoiding the supplemental index entirely! Your mileage may vary on these suggestions, but these are solutions to very common things I’ve seen time and time again in both my blogs and other sites. As far as I know, everything plugin and code wise is compatible from 1.5 up to 2.1.
Permalinks
The first thing you’ll want to do is set up your permalinks. Go to Options, Permalinks. You’ll want to choose the custom option. I like to set my custom permalinks to just /%postname%/. I just like keeping it short, simple, and sweet. There’s plenty of different options there, so feel free to try out what looks best for you.
Chances are, you will either need to make a blank file named .htaccess and allow wordpress to write to it, or you can just copy and paste the code it gives you and put it in a file named .htaccess. Then upload it and viola!
Title Tags
The next thing I do is change how the title tags are set up. I really don’t like having the blog name repeated in every title, especially considering how important the title tag is for Google based SEO. So I install a nifty little plugin called SEO Title Tag. This allows me to have a great deal of control over how the title appears on my pages. You can read the full installation and setup instructions on their page.
Categories and Date Based Archives
Now I address the category / archives pages. This is where a lot of the duplicate content issues come into play, since most themes show the full posts, plus you run into posts that are in several categories, in the date based archives, etc. There are several options to fix this, including one that I’ll go over later involving the noindex tag. My simpliest fix is simply editing the templates so that only the title tags show for each blog post, when viewed in category or archives view. This requires opening up the archive.php file and looking for the part where it displays the posts.
You’re looking for the template tag < ?php the_content(); ?> or something along those lines. Since I’m only using the post title in my category and date archives, I just remove this out completely and only leave <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to < ?php the_title(); ?>">< ?php the_title(''); ?></a>
If that is a bit too barebones for you, the other popular option is to remove < ?php the_content(); ?> and replace it with < ?php the_excerpt(); ?>. You can either custom define an excerpt in the optional excerpt field when you make a post, or Wordpress will generate one from the first 55 characters of your post. Either way, this will ensure that your posts aren’t shown in their entirety on the archive pages. I also tend to only use categories for archives, instead of date based archives. That is more for the purposes of micro niche advertising than anything else, though.
Meta Tags
This topic comes up again and again - metas are important, no they aren’t, yes they are…etc etc. My opinion is that it certainly serves to help out your SEO efforts, and they aren’t that much of a bother to add in. So why not? There are two separate plugins that I use to help me out in this aspect of Wordpress setup, depending on the age of the blog and the level of my anal retentiveness that day.
The automated option is the one that I use for older, more established blogs with lots of posts. The last thing I want to do is go and write all that stuff by hand when there’s hundreds of posts waiting for me. For this scenario, I employ Add Meta Tags, which will automatically generate your main page meta tags (from your tagline and categories), your single post metas (from excerpt and categories), and category pages (using the category description). You can also override any of these options using the plugin, either by its admin panel or custom fields (in the case of posts and pages). You can read the full instructions and features of the plugin at their site.
If I’d rather just do all the meta work by myself, and want a nifty meta description and keyword field right under the post box in the Write Post page, I use Another Wordpress Meta Plugin. This plugin allows you to set everything yourself on posts and pages, as well as giving you the option to define your home page meta tags. Categories are, once again, given meta descriptions based off of their description.
WWW and Non WWW URLs
Another thing you might have noticed is that Google is picking up both the www.domain.com and http://domain.com in the SERPs. You will want to set it so that only one is the actual URL, and the other version does a 301 redirect to it. This will require you to edit your .htaccess file, which also contains the information for your permalink structure you set up earlier.
Here’s an example of a 301 redirect
RewriteEngine On
RewriteCond %{HTTP_HOST}!^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
RewriteRule . /index.php [L]
While on the subject of altering your .htaccess file, you can also rewrite all URLS to end with a slash, instead of having the non trailing and trailing slash version.
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.domain.com/$1/ [L,R=301]
There’s a lot more that can be done with the mod-rewrite feature, much more than I could cover in this quick tutorial.
Picking and Choosing What Gets Indexed
My biggest pet peeve in the world is when Google picks up and indexes my feed over my posts and blog. This pushes the single post pages into the supplemental index more often than not, and when it hits both the main feed generated by Wordpress, AND the comments feed - well you can see how this would get super messy.
The method that I use to get around it involves employing the noindex tag for the robots to pick up on. This code needs to be inserted into your header.php (or wherever your <head></head> tags show up at in the template).
< ?php if(is_home() | is_single() | is_page() | is_category() | is_archive()){
echo "<meta name=\"robots\" content=\"index,follow\">";
} else {
echo "<meta name=\"robots\" content=\"noindex,follow\">";
}?></meta>
In this example, the home page, single posts, pages, categories, and archives are all indexable, while everything else (which includes those pesky feeds and trackback urls) is not allowed to be indexed (but with the follow tag, the robot can still pass through links on those pages).
Hopefully this will help you out in your blogging journey! This is obviously not a be all, end all guide as there are countless ways and many great plugins for each of the areas I’ve discussed. Hopefully this will get you off to a good start, though. :)
Disclaimer: I know I don’t have all of this set up on Sultry Services, mainly because I’m switching over to a new design and backend soon. These do get used on all of my active sites. :)