Entries from January 2008 ↓

Practical Search Engine Optimization (SEO) tips

If you search for the keyword SEO online, there are hundreds if not thousands of sites out there offering advice, consultancy and “top 10″ SEO improvements that you can make.

What I’m hoping this article will do is look at the problem from a practical angle based on what I’ve learnt from working with SEO experts who I rate highly and from real world experience running many websites. I’m not offering any commercial services on this site and will try and remain impartial to give you what I believe are the best solutions for getting your website higher in the rankings than others.

What is SEO?

First, I guess I’d better clarify what I mean by Search Engine Optimization or SEO. When I say SEO, I mean the process of improving the volume of traffic to your site from search engines and improving the chances of your website appearing higher in search engine results for specific keyword combinations that are relevant to your site’s content.

A few words of warning though. Nothing in the SEO world is guaranteed and anyone who says otherwise isn’t being completely honest with you. By applying the SEO tips in this article the chances are that your site will move up in the search engine rankings but by no means would I ever say you’ll get to page 1 of the search results.

Google, Yahoo and MSN never publish their algorithms and they are always being updated. If you try and trick the engines you’ll eventually be caught out and your site may drop like a stone or even worse you may be blacklisted. Attempting to trick the engines is often called “Black Hat SEO” and is definitely not recommended by me.

It takes time

Like all the best things in life, SEO takes time. Don’t expect to make changes to your site and see an overnight improvement. In my experience, many changes can take between 1 and 3 months to start making a difference. This is a double edged sword because if you make a change incorrectly or try something new that doesn’t work, you won’t notice for some time then once you do it’ll take ages for the fix to make a difference.

So, with that said, let’s get to the SEO tips:

Practical SEO tips

1. Understand your site

Before you embark on any SEO related improvements, the first step is to understand your site and your current traffic. I would recommend three proven methods:

1. Google webmaster tools
2. Google analytics
3. Xenu link checker

Google webmaster tools will tell you exactly about your site’s visibility in Google, where your site has errors, who is linking to you and how often the site is crawled. My favourite feature is top search queries which is able to tell you keywords people have used and where your site appeared in the results even if they did not go on to click your site.

Google Analytics has to be one of the best online toolsets available. By adding a few lines of code to each page on your site, Google Analytics allows you to track visitor numbers, landing pages, page views, time on site, geographic breakdown of visitors and even the city they came from.

Xenu is a downloadable tool that will quickly analyse your site and report all broken links. Invaluable.

You should spend a lot of time with these tools. I personally use Google Analytics daily. You should review traffic and then optimize your content and pages accordingly.

2. Content is king

Nothing is more important than content. A well structured site without content is like a ferrari without an engine - great looking but useless. You need to love writing articles, managing feedback, reviewing links and everything else associated with running a website with real visitors.

Remember that your site is for two audiences - real people and search engines. However your content should only be written for real people. Don’t create clusters of keywords or worry about keyword frequency and density. Simply write regularly with content and articles that are consistent with your site’s intent and that you think your readers will enjoy reading.

There’s no clear rule on frequency but I would recommend trying to post at least a couple of articles per week. It is important not to copy content from other sites and not to plagiarize. Search engines hate duplicate content and will penalize you accordingly. Copyright owners will chase you if you use their work without permission - a polite request is often all that is required if you want to use material from others on your site.

3. Other sites need to like you

If you write good quality content the visitors will come and other sites will link to you. If you are starting out, link directories are one way to quickly build inbound links but be careful as Google is beginning to penalize sites that do this.

I would recommend the SEO friendly directory site for a list of quality directories. After you’ve been running for a while you will find you need these directories less and less.

4. Remove page errors

404 errors, server errors, missing links are bad for your users and bad for search engines. Use tools such as Xenu and Google Webmaster to eliminate them.

You can read another article about how I was caught out by a strange 404 error.

5. Make life easy - use a content management system

If your site is hand coded using PHP, ASP, JSP or any other fine coding language and your content is coming from a database or even worse static you will spend hours updating, tuning and improving.

Some people love this but as you create more sites and more content it will begin to wear you down.

Using a Content Management System will make a huge difference - many now come with embedded features such as feeds, tags, pretty URLs and page designs that are very SEO friendly. I am personally a big fan of WordPress and I use it for both blogging as used in this site and also as a general purpose content management platform. WordPress has an extensive library of plugins, many of which are ideal for SEO purposes. I run WordPress with plugins for MetaTags, Tag Clouds, Feedburner and Google sitemaps which all help me with search engines.

6. Titles, titles, titles

Make sure every page on your site has a unique title and that the title accurately describes the content of the page first using relevant keywords. For example, on a website about travel and a page about Italian hotels, instead of the title “TravelSite”, put the page description first and the site title last like this “Hotels in Italy ~ By TravelSite. Everything about Travel”.

Not only will this give your pages unique titles but it will also give search engines an indication of relevant keywords for pages and make the title clear when the page is listed in search results.

7. Page tag structure

After the title, you should structure your page in a clear hierarchy. H1 tags are the most important but only use this tag for content titles on the page that are significant. One or two H1s per page is really enough. Including too many will confuse the search engine.

After the H1, use H2s for article/section titles, H3s for subheadings and so on.

The rule is to give your page a clear keyword and content hierarchy to help the search engine (and your visitors) navigate the page.

Finally, I would also recommend a one line footer that links back to your home page containing a sentence with your most important keywords. For the travel site, this could be “TravelSite - Accommodation, Flights, Guides and Discussion about top holiday and travel destinations worldwide”.

8. URL format

Many sites use a confusing URL structure such as http://site.com/page?parameter=22342. No keywords are included and it gives readers no indication what the page is about. I would recommend a keyword based URL format such as http://site.com/545/skiing-and-snowboarding-in-canada

You can immediately see that this URL is both search engine friendly and user friendly. If you use a platform such as WordPress, it can create this URL structure for you automatically.

9. Sitemaps

A sitemap is an XML file that guides a search engine to find all of your pages, it also tells the engine when pages are updated and which pages are more important than others. As your site becomes more important you will rely less on the sitemap but for new sites, it’s a vital tool. There are many tools out there that can create sitemaps for you automatically.

The second sitemap I would recommend is a human readable HTML sitemap that acts like a simple index to your site. Incuding this somewhere on your site not only provides a quick way for people to locate pages that may otherwise be difficult to find but also acts as a keyword guide for search engines.

10. Image optimization

Give every one of your images an ALT tag that describes the image to search engines.
Also, use Google Webmaster tools to allow image indexing of your site - it’s amazing how many extra visitors can come from a Google image search.

11. Link optimization

Give every one of your links a TITLE tag and also a description containing keywords. So, instead of:

<a href="http://www.somesite.com">www.somesite.com</a>

Do this…

<a href="http://www.somesite.com" title="A site about travel around the world">A site about travel around the world</a>

Again, this gives search engines those vital keywords.

12. Page rank

Page rank (PR) is a hotly debated topic within the web community. A site’s Google page rank is often seen as the badge of honour or embarrassment for a webmaster. Whole websites are devoted to discussing page rank and “High PR” directories abound that will only list websites with a PR4 or higher.

In simple terms, a page rank is a numerical value from 0 to 10 that indicates that web page’s measure of “importance” within the web community. The Google toolbar provides a toolbar that gives an indicative page rank for each page you visit or there are many websites out there that will show you PR values. The true Google page rank is of course hidden within Google’s search algorithm.

When you include a link to another site on your page, part of your page’s PR is given to that site. Conversely, when a site links to you, part of that site’s PR comes your way. This sharing of PR (or “link juice” as I like to call it) is how the PR system works and part of how search engines determine where pages are displayed in search results.

The idea of course is that the higher your PR, the higher your page will appear in results. Whilst this is of course partially true, there are many other factors that will also affect your results and PR is just one of them. I personally recommend that you don’t worry about PR too much. If you write your site well and keep posting good quality, relevant content then sites will link to you, visitors will come and your PR will increase. However, once you’ve got your PR, don’t just give it away…

13. Don’t give every link away

If you’ve read the PR topic above, you’ll see that I recommend that you don’t worry unduly about PR - it will come. The key thing is thought that once you’ve got your PR, don’t just give it away to every site that asks.

As your PR increases, you’ll be inundated with requests to share links with other sites. This will give away a small portion of your PR in return for a bit of theirs. If they have a lot of links and/or a low PR you’ll only get a tiny portion of page rank from them whilst you may be giving away more.

At the start of this article I talked about writing for two types of user - real people and search engines. People reading your site are the most important and I certainly recommend including as many links as possible to other sites that you think your readers will find useful but you don’t have to give your PR away on all these links to the search engine user.

If you want to include a link for your readers but instruct a search engine not to follow the link (and therefore not give your PR away), here’s what you do:

<a href="http://www.somesite.com" rel="nofollow">The link text</a>

Notice the “nofollow” within the tag. To a normal user, the link appears normal but to a search engine, this say stop there.

Using this technique, you can give your PR away to only those sites you choose to whilst still giving your readers the benefit of interesting links. This may not sound very community spirited towards fellow webmasters but it’s a competitive world out there and I can see the use and dominance of PR being reduced in the future because of this feature.

A website bites the hand of its creator

Ah the joys of development. You spend hours crafting crafting code into a functional website, you run as many tests as possible to iron out those frustrating bugs, finally you “go live” and release your creation into the world.

That’s when it really starts to test your patience. New bugs, Gotchas, missing links, misbehaving dynamic content you name it, it will happen. Then when you think you’ve fixed all those, something else will come along to kick you.

Today’s rant from me is because of a site that I thought was running perfectly. Orders were coming in (albeit slowly), traffic was reasonable and life was good…. until I checked my trusty Google Webmaster tools and discovered over 750 page not found 404 errors in my site for pages that I thought were working perfectly well for the user.

So, here’s the situation. A URL that worked absolutely fine from any web browser was returning a 404 page not found error to search engines. Suddenly Google and Yahoo think that my site has disappeared into vapour and those pages that have taken months to creep up the search results drop like a stone.

The reason for this was that I’d tried to be clever by integrating Wordpress as a Content Management System (CMS) into an existing site.

I’m a BIG fan of Wordpress, not only as a blogging platform at which it excels but also as a generic CMS that I can use to create dynamic content for my sites. Out of the box it includes a fantastic admin system, hundred of plugins, great php based API, user management, commenting system and of course Google loves content and Google loves blogs which really helps with my SEO efforts. I’ve used Wordpress successfully now to add regularly updated content to a number of site - for example, I use the Amazon Web Services API to query the Amazon database and create website that sell specific products such as Jewellery (Jewelry for US readers!). By using Wordpress as a CMS I can dynamically bring in articles relevant to specific sections of the Jewellery site - for example, an article about the latest deals on Watches in the Watches department.

Back to my problem… what I done in my site is use an .htaccess file to allow pretty URLs to be used. For example: the URL /products/department/watches would actually go to the file /products.php?department/watches.

To integrate Wordpress into a site, you add the following code:

<?php define('WP_USE_THEMES', false); ?>
<?php require('./blog/wp-blog-header.php');?>

Wordpress doesn’t seem to like me using an .htaccess file that isn’t in sync with it’s own Permalink structure, so when one of my pretty Wordpress URLs was passed to wp-blog-header.php, it couldn’t work out where the page was and returned a 404 error … but only to search engines!

I haven’t figured out why a 404 was being returned for search engines but users could quite easily see the pages. That’s the a real mystery that I’m hoping readers of this site may have the answer to.

Hosting with Dreamhost

I don’t intend for this site to be full of promotional rubbish or adverts but I have to say a few positive words about my hosting provider Dreamhost.

Over the years I’ve used a number of different companies, usually at the lower end of the budget (which of course you’ll say is why I’ve had problems) and they have all had their faults - poor site performance, poor support, restrictive terms, price creep an so on.

So, in 2007 I decided to consolidate all of my sites onto one provider. I looked into private hosting but I couldn’t really justify the price and in many cases my databases and email would still be shared. So it was back to shared hosting.

After extensive searching I discovered that many people recommended Dreamhost and the benefits certainly seemed tempting:

For a start 500Gb of disk storage and 5 Terabytes of monthly bandwidth that increases by 40Gb a week. Then they add in unlimited domains hosted under one account, unlimited email addresses, unlimited mySQL databases and support for advanced features such as video streaming.

All from $5.95 per month and I’m not even getting close to their bandwidth limits at the moment.

Too good to be true you might say but using Dreamhost has allowed me to currently host 7 of my sites within one affordable account and the performance to date has been excellent.

Their support has also been exemplary. A recent example was when I contacted their support team on Dec 31 (New Years Eve) and they came back to me within 10 minutes with a solution to my problem.

Anyway, don’t just listen to me, take a look at them for yourself.

PHP sessions and simplexml_load_string

In all the sites I’ve developed to date, it’s actually quite rare to find a php bug so although this issue took me a day to fix, I’m actually quite pleased to have found one.

The issue:

Basically, using the php simplexml_load_string() function appears to affect session handling and corrupts the data used in the $_SESSION data causing the error “node no longer exists” error when session_start() is called.

I was using the session system to keep a breadcrumb history for a store I’m developing (retailhealing.com) and had a handful of session varables, each representing a page in the breadcrumb history (crumb1, crumb2, crumb3, … etc).

The code was something like this:

session_start();
...
for ($i=1;$i < 5;$i++)    {
   $snode='crumb'.$i;
   $sdesc='crumbd'.$i;
   if (!isset($_SESSION[$snode])) {

 	$_SESSION[$snode]=0;
 	$_SESSION[$sdesc]='';
  }
}

...

[later in the code, I was also using simple XML]

$parsed_xml = simplexml_load_string($xml);

After the first call to session_start(), when the page was refreshed, I kept getting a ‘node no longer exists’ php error and I couldn’t figure out what was going on.

The solution

A Google search revealed a case similar to mine but the unfortunate poster seems to have been initially flamed by the respondents who rejected it as a bug.

This case was discussing the use of the simplexml_load_string() which I was also using in my code. As a test, I commented out all calls to this function and reloaded my pages. Everything worked just fine.

This pointed the finger of blame directly at the simplexml_load_string() after I of course had spent hours looking at how I was using the $_SESSION[] calls in my code looking for an elusive typo!

So, what was I to do? I could of course just not use simplexml and use a more complex XML parser but I really wanted a quick solution.

The answer was in fact included at the bottom of the case returned in my initial Google search. You need to cast all non string values assigned to session variables to strings as follows:

 $_SESSION[variable]=(String)value;

So, my code snippet above now looks something like this:

session_start();

...

for ($i=1;$i < 5;$i++)    {

   $snode='crumb'.$i;
   $sdesc='crumbd'.$i;

   if (!isset($_SESSION[$snode])) {

 	$_SESSION[$snode]=(String)0;
 	$_SESSION[$sdesc]='';
  }

}

This is the first and only time I’ve had to use casting in PHP and I’ve no idea why I need to do it in this case… I’m sure there must be someone out there who can explain?