So I’ve recently become aware of some of the SEO boo’s an out of the box wordpress install will inflict on your blog (actually I shouldn’t use inflict, because wordpress is great tool, but I’m using my poetic license :).
The key problems are duplicate content and sub optimal page titles. There are probably a plethora of other articles going in to great detail on this very subject and no doubt a good many plugins, but I just wanted to knock up a quite list so I could keep a note of the key steps and blindly apply them on other installations later on.
Improve Page Titles
We want the page title to be the title of the post, edit header.php and change the title tag as follows:
<title><?php if ( is_home() ) { bloginfo('name'); echo(' — '); bloginfo('description'); } else wp_title('',true); ?>%lt;/title>
Fix Duplicate Content
Insert the follow code in header.php after the title tag – this stops robots indexing the pages where your posts are duplicated:
<?php if((is_home() && ($paged > 2 )) || is_date() || is_category()) {
echo '<meta name="robots" content="noindex, follow, noarchive" />';
} ?>
Improve Permalink Structure
Ultimately, we want to have the page urls for each post as http://www.blogname.com/seo-friendly-post-title/.
- Login
- Go to Options
- Then click on Permalinks
- Change the format to ‘Custom’ with the following format
/%postname%/
- Submit
You can also use post slugs to manually tweak the url. E.g. You might want to change:
http://www.blogname.com/really-long-and-diluted-post-title/
http://www.blogname.com/cool-title/
Simply edit the post slug when you are writing a post.
Redirect Canonical To Urls
Your site should be on www.blogname.com or blogname.com – not both.
If your hosting supports it (and is apache based), you can edit your .htaccess file to set up a redirect. Assuming you want www.blogname.com (rather than blogname.com) add the following lines to your .htaccess file in your wordpress dir:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www.blogname.com [NC]
RewriteRule (.*) http://www.blogname.com/$1 [R=301,L]
NB If you aren’t using url rewriting yet, you should add the following line aswell to enable URL rewriting:
RewriteEngine On
Stop Robots indexing your feeds and other unwanted pages
You can tell the robots (search engine spiders) not to index certain pages, edit your robots.txt filre to include the following:
User-agent: *
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
Disallow: /trackback
Disallow: /cgi-bin
Disallow: /search
Disallow: /feed
Disallow: /rss
Disallow: /comments/feed
Disallow: /feed/$
Disallow: /*/feed/$
Disallow: /*/feed/rss/$
Disallow: /*/trackback/$
NBIf your blog is in a subdirectory, prefix the above with the blog directory name, e.g.
/rss => /blog/rss
Install the blog in the top directory or on a subdomain
Optimally your blog is on it’s own domain, so www.blogname.com goes straight to your blog, and it’s not installed in a subdirectory like www.blogname.com/blog. When you install wordpress, be sure to move the extracted files out of the extracted directory and into the top directory of your site.
Alternatively set up a subdomain for your blog e.g. blog.mywebsite.com.
Helpful Plugins and Themes
The K2 extension TripleK theme is used by this site, and automatically applies some of the above fixes.
I’ll add some more ideas some!
Referneces
- Webmaster World Discussions http://www.webmasterworld.com/google/3084893.htm >http://www.webmasterworld.com/google/3097706.htm
Christopher Ross says
Great SEO post! Thanks.
douglasb says
If you are targeting a specific keyword phrase, but can’t get the keyword for the domain, would it be good or not to do this:
phrase: “pizza sauce recipes”
domain “pizzasauce.com”
domain with wp installed in folder “pizzasauce.com/recipes/[word press index file here]”
Would that be good or bad for SEO?
Doug
Mr Kirkland says
Having keywords in the domain and url is generally considered to help your search engine results for the keywords in question, so all other things being equal, this sounds like a good thing for SEO on these terms.
argusyk says
Very useful post! Do you know any plugin for auto tagging urls with alt and title?
Eddie says
I have thought about changing my permalink structure to /%postname%/ several times in the past. After coming across your post I googled it and came across this:
http://comox.textdrive.com/pipermail/wp-testers/2009-January/011097.html
I’m not sure if this issue has been addressed since January 2009, but in the WordPress codex using /%postname%/ is not recommended because it does not scale very well.
Any experience to whether this holds water?
Mr Kirkland says
Eddie,
I’ve used /%postname%/ on quite a few blogs and had no issues. The page you link to seems to suggest that the /Êtegory%/ is the part causing the performance issue.
Atchuthan Sriskandarajah says
The Fix Duplicate Posts is good piece of code.
Scott Dylan says
I use /%postname%/ on various blogs and have never had any problems.
Darkened Soul says
Thanks for this one, , good article
numous says
Nice seo trick, i write it for my customer and working this aio seo trick. ^_^ love it
Kevin says
Cheers, the title tag and duplicate content one will really help.
Kelvin @ Bloggers Ethics says
Thanks kirkland for sharing these SEO cheats… I hope it works in this new wordpress 3.3.1… Thanks so much