Web Stuff

SEO Your WordPress Blog

18 Aug 2005  •  Written by Mark

I’ve spent the last 2 weeks or so tweaking my blog application to be more SEO viable. This involved a number of re-arranging techniques and a couple of plug-ins, rewrite rules and includes that have decidedly increased the traffic to my site by means of SERP‘s. I decided last night whilst I was in the bath, that I’d document the steps I took in order to help and assist others who’d like to improve their blog’s SEO.

Lets start from the top of your page…

The <title>
The title tag is what shows right at the top of your screen. It plays quite an important role from the point of view of a SE Bot. Your page could be all about hot-dogs, but if the title of your page is Web Design, the bot isn’t going to see your page as entirely hot-dog related and your SERP won’t be favorable.

It’s quite easy to tweak this as the WordPress application already has a function to call the title. Thus you can simply insert this into your <title> tag.

<title>< ?php get_the_title () ; ?></title>

This calls the title of your entry and puts it in the title of your page.

If you’re however on the home page of the site, there won’t be a blog title to put in your <title> tag and would result in an emtpy <title> which you don’t want. You can append something after the above php command.

<title>< ?php get_the_title () ; ?> on Hotdogs.com � All you need to know about Hotdogs</title>

Your default title then would at all times have the above phrase which would at least have your keyword/keyphrase.

The <meta description>
The SERP will display your page description as given in the <meta> tag. Ie when a person searches for something and your site is one of the results, the person will see the description of your page.

It will aid your SEO if the description of that page is totally related to the blog entry itself. The best way to do this, I’ve found, is to have another php function that inserts the_excerpt of the article into my <description> tag. For this, I used a plugin that is painfully easy to install (thank you Kafkaesqui). Download the file, and save the extracted php file into your plug-ins directory. Go to your wp-admin and activate the plugin. Thereafter insert this code in your header (preferably under your <title>)

< ?php head_meta_desc(); ?>

If you open the actual php file offline (or edit it via wp-admin) you can edit how many words of the excerpt you want to echo in the description tag. Personally, I wouldn’t recommend going more than 30 or 40 words maximum. It’d be wise then too, when you’re writing your article’s excerpt (or in the opening few words of your article if you’re letting WordPress generate the excerpt automatically) to mention your key phrases a few times. Thus the SE Bot is going to see that key phrase when it scans your <description> and the person seeing your SERP is going to know that your page is based on �hotdogs’.

On your index.php page however, there is no article to pull an excerpt from..well actually there’s a whole bunch of excerpts and the function thus renders an empty description tag. You naturally don’t want this to happen. Fortunately my mate Fredix hooked me up with a simple tweak to the above pluggin which provides a sort of a default status. The tweak says that if the string-length of the description tag = 0, then it reverts to a separate description tag. Thus on your index.php page or any other page where there’s no specific excerpt to use, it’ll revert to your default description. The tweak is as follows:

if ( strlen( trim( $description )) == 0 ) {

$description = ‘Hotdogs rock my world� Yum';


The <permalink>
I’m sure this is a given, but just in case (or for the newer WordPress converts), your permalink can be set up to show the actual post name in the url. In your wp-admin center you can click on �options’ and then ‘permalinks’ and specify the way you want your permalinks to display. It is possible for the title of your article to be different from the page URL (say for example you want your header to be H-O-T-D-O-G-S but you want your URL to be ‘hotdogs’). When you’re writing your post, make your title as you want it and then scroll down to the post ‘slug’ you can there specify how you’d like the actual URL to display, which in the above example’s case would be �hotdogs’.

The <content>
Granted, you’re probably not going to want every post to be jammed with keywords and have a high SERP. Often you just want to rant about something and you’re not too worried about the SEO. But there are occasions when you are going to want the SE Bot to notice your page’s content and give it a good SERP. If that’s the case then you’re going to want to aim for a 4-5% keyword saturation in your content. Which means that for every 100 words of text, you need to have your keyword or phrase at least 4 to 5 times. It won’t hurt you to bold these occurrences. It’s perhaps wise to note that you’re probably not going to want your page to look too spammy with chronic amounts of bolded text. Enter CSS stage left. The <strong> and <b> tag are given equal importance by SE Bots so you can edit the CSS of the <b> for example and have it display the same as normal text. So the user sees plain text whilst the SE Bot sees bolded text.


You need to remember that your SERP will be a lot better if the information of all of the above is related. For example if your title is ‘web design’ and your description is ‘scrap-booking’ and your bulk of content is about hotdogs then the SE Bot will be confused, so to speak and your SERP will be adversely affected.

Optimally your page should have a URL that has your keyword, ‘hotdogs’, in it and a title tag that indicates your site is about ‘hotdogs’. Your description should have the word ‘hotdogs’ in it a few times at least and you should have a bunch of content on ‘hotdogs’ with a few bolded occurrences of the word. Then the SE Bot will be left in no doubt that your page is about hotdogs and your SERP will be favorable.

Let me know if you’ve successfully applied any of these tactics yourself and what the results have been.

Right, now I’m off to get a hotdog.

12 Responses to SEO Your WordPress Blog

  1. One thing you may want to add to this is tagging. While I don’t think tagging is any hugely revolutionary thing, I do get quite a bit of traffic via Technorati and Google from the tags I use in posts. I use “Bunny’s Technorati Tags” plugin for WordPress, but there are others out there, too, if a person doesn’t like it.

    Another thing you may want to point out is the value of having a robots.txt file in the root of your site. Not every web crawler looks for one, but many still do. Robots.txt can also give you more power over what you don’t want a search engine to crawl, like images, for instance.

    Just some thoughts. :)

    Lelia Katherine Thomas  •  18 August 2005 6:52 pm
  2. Very valid points Lelia…Thank you very much for your input. Hopefully the tips and pointers left here, when combined, will be helpful to those who come across it.


    MarkB  •  18 August 2005 8:40 pm
  3. This is a great basic overview. There are a few other things that should be considered like making your site as search engine friendly as possible. Some WordPress Themes feature content in iframes – bad SERP stuff.

    Keep the most critical content for search engines at the TOP of your site’s code. WordPress does that with the Classic and Default Themes, and most Themes based upon them, by having the order of content within the source code be header, content, sidebar, footer, but I’m seeing a lot of Themes that are changing the order to header, sidebar, content, footer, which pushes your keyword content down lower. Many search engines don’t scan the entire page but only the first third or so to add to their database. The further your content is from the top, the less likely they are to grab the content.

    Help search engines crawl through the pages on your site with good navigation links and frequent links within the content to other posts within your site. The easier you make it for search engine to move from page to page within your site, the faster they can gather the information. WordPress makes it easy, but intrasite links and good navigation links helps.

    Link popularity has been replaced with trackbacks and pings for the most part, so make sure those are in fine working order. And be sure and make your site worth of being linked to so you encourage links, which does help with SERP.

    Feeds are becoming more and more important, and while WordPress has great feed capabilities, make sure your feeds validate and enhance your feed-ability by making sure that the various feed types are visible on your page or can be found by feed readers.

    There are several sites on the net that will show you what a search engine really “sees” when they scan your site and those links would be a nice addition to your article.

    There is also a lot of great info in the WordPress Codex in the article on Search Engine Optimization for WordPress.

    Great work. Spread the word – WordPress is great for SEO, but a few tweaks always helps!

    Lorelle  •  19 August 2005 12:35 am
  4. Thanks Lorelle! A number of very valid points there… Yeah, frames are bad news for SEO…

    I’m busy with another article now thats along the lines of Site Layout VS SEO Viability… Couple of nice techniques (especially if you have a nav (especially drop downs) at the top of your page) to layout your site in a SEO Friendly way…

    Great comment Lorelle, Thanks..

    MarkB  •  19 August 2005 9:19 am
  5. A well written article Mark.
    It sure has made me think about tweaking my site a bit. Thanks :)

    Shriram  •  8 September 2005 12:43 pm
  6. nice post…

    A few comment I’d like to make:

    Use lots of variations of your keywords / phrases in your content ie:

    juicy hotdogs with mustard and sauce

    mustard and sauce with juicy hotdogs

    hotdogs, juicy with sauce and mustard

    Don’t dilute your title with your company name if it doesn’t have your keywords in it

    Don’t use keywords in your meta text that aren’t in your content

    Use your keywords for you image alt text

    Use keywords in italics as well as bold

    Place your keywords right at the bottom of your page as well as the top

    Use a sitemap to index all your pages – you can use the Google Sitemap Generator

    Karl  •  25 September 2005 5:23 am
  7. Nice comments Karl :)

    Thanks for your input.

    MarkB  •  26 September 2005 12:09 pm
  8. Thanks for this article VERY essential for all WordPresse users. I was definitively looking for this information !

    paul  •  12 October 2005 4:35 pm
  9. Hello ! Thank you so much for your article.
    I am having trouble to add the tweak for Headmeta desc.
    In the head-meta-desc.php :
    Where to add the following codes? :

    if ( strlen( trim( $description )) == 0 ) {

    $description = ‘Hotdogs rock my world… Yum’;


    I am getting Parsing error each time.

    Thanks again

    Sameer  •  20 October 2005 12:03 pm
  10. Sameer…

    In the actual .php file that you put into your plug-ins folder: head-meta-desc.php…

    Right at the bottom of the code, insert the code so it looks as follows:

    } else {
    $description = get_bloginfo(‘description’);
    if ( strlen( trim( $description ) ) == 0 ) {
    $description = ‘Hotdogs rock my world… Yum';

    echo “\n”;

    add_action(‘wp_head’, ‘head_meta_desc’);

    I’ve added you as a MSN contact on your hotmail address if you want some more help.

    MarkB  •  20 October 2005 12:31 pm
  11. Thanks Mark
    I tried the code as above …but am still getting Parse error line 65
    $description = ‘Hotdogs rock my world… Yum’;

    Can you please send me your head-meta-desc.php file

    Thanks again for your help

    Sameer  •  22 October 2005 7:21 pm
  12. Nice tut, fellow South African. funky wordpress layout.

    Doug  •  4 November 2005 6:30 pm