Wednesday, January 14. 2009
A while ago I had to do a Search Engine Optimization (SEO) ticket for our blog. But small as this fix actually was, changes are already visible in the search results of common search engines. The problem was that regardless of the user that wrote the blog, they all had the title 'Ibuildings Blogs'. Search engines are really not so bright and think: same title equals same article. Blog posts could only be found by searching for a part of the sentence in the post itself, which isn't an ideal situation at all. Being a PHP developer and not one our SEO specialists, I got interested in the topic, and decided to share my findings in this post. What I wanted to find out was, what are important best practices for this so called search engine optimization?
With my favorite search engine I started looking for some answers, sites about SEO should be easy to find, rephrase, on top of the search list! According to what I've found I made a sort of short and easy dos & don'ts list. For the sake of example, I'll use a non existent shoe store called, how inventive, fake-shoe-store.com.
So here we go, some basic guidelines for Search Engine Optimization:
- Download a text based browser, and just browse your own site. If it's hard to find/navigate to useful information yourself how can a crawler possibly find or index it?
- Make sure your site has a clear hierarchy based on textual links. All the pages visitors are allowed to see should be reachable from a static link. This does not mean you should put all your links on one page though, 80+ links will not improve your ranking.
- Easy to forget: check for broken links, they all count. Use 301's when pages have been moved, add for example a "RedirectPermanent" to an .htaccess for example to redirect the crawlers.
- Create useful keywords. Give each page its own set of keywords no longer than two keyword phrases of 3 or 4 words long. The longer the phrases are, the less effective they will be or even ignored when misused. Also keep in mind that most search engines ignore so called 'stop words' like: about, www, com, the, a, etc.
- Your <title> elements and alt attributes should be descriptive and accurate, in other words, use them for what they're intended to do. A title should contain the title for the page you're looking at, and an alt attribute of an image tag should contain a short description of what's to be seen on the image. For example:
CODE: <title>Improve Search Engine Optimization</title>
or
CODE: <img src="/blog/uploads/seo_img_example.png" alt="SEO image tag example" />
- To improve page ranking even more, you should combine the two above mentioned points. So also use your main keyword phrase in your title. Watch out for titles above 60 characters; keep them short, simple and relevant.
- In addition to the previous point; use proper heading tags (<H1> etc). Markup can be done using div's or span's, but when you read the newspaper you also scan headings don't you? When you remove the heading tags a crawler interprets it as normal text, and will give it lower relevance.
- Maybe needles to say, but whenever possible make sure your page is a valid page. A browser will probably display a non valid page properly, a crawler on the other hand.. doesn't. When you forget to close a nested table for instance a browser knows what to do, a crawler exits.
- When you have dynamic pages (i.e., the URL contains a "?" character), note that not every search engine crawler crawls dynamic pages. It's better not to use many parameters; when possible rewrite your URLs to a readable format:
CODE: fake-shoe-store.com/index.php?category=male&type=6&brand=14
should ideally be:
CODE: fake-shoe-store.com/male/sneakers/nike/
- Be consistent in your link naming, so when you put a slash after fake-shoe-store.com/male/, always do the same for the rest of the links. Or when you refer to a specific page like fake-shoe-store.com/male.php keep it that way throughout your site or at least in your navigation.
- Spent some money on (top-level) domains, it's worth the extra bucks. You'll not only have the advantage of being found easily (everyone once in while tries to guess a website), but you could make your multilingual site easier to find when your Dutch website refers to fake-shoe-store.nl rather than fake-shoe-store.com/nl/ for example.
- Help or prevent the crawlers crawl, use the robots.txt file. All major search engines use this file as a guide and it's probably the most easy way to influence your search results. See the examples below to get an idea of what your robots.txt can do:
Allow all crawlers to crawl your complete website:
CODE: User-agent: *
Disallow:
Keep all crawlers out:
CODE: User-agent: *
Disallow: /
This example prevents crawlers from crawling the disallowed directories.
CODE: User-agent: *
Disallow: /admin/
Disallow: /tmp/
Disallow: /private/
- In addition to help crawlers do their job, you could create an XML site map and submit it to the search engines that support it. Such a file looks like this for example:
CODE: <?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>http://fake-shoe-store.com</loc>
<lastmod>2008-12-16</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
</urlset>
When you submit your site map, its location should be the complete URL to the site map, such as: http://fake-shoe-store.com/sitemap.xml
Tip: download a site map generator to do the hard work for you.
- It's better not to use JavaScript for redirects, not only does it make your linking inconsistent, but also JavaScript will be ignored by search engines so an opportunity will be missed there.
- Prevent duplicate content on your website, this is confusing for users and crawlers who crawl your site. When duplicate content is found, this will negatively adjust your page ranking. It's better for instance to create a separate CSS file for printing a page than to create a separate printer friendly page with the same content. Or a more common example: write a short copyright text on the bottom of your page with a link to your complete disclaimer and extra details instead of a lengthy text at the bottom of your page.
- This last one is perhaps a bit over the top, but choose your hosting company carefully. If the same server hosts some 'bad hats', also known as spammers, pornographers, etc, your site and your page ranking will be banned by association. As I mentioned earlier crawlers are not that bright and tend to think that it's the same site because they all share the IP address of your hosting server.
Big question is.. will all these optimizations put your site on top of the search results? Although you can do a lot to improve your page ranking, there's no guarantee it will. People still have to visit your site to become relevant, but optimising your site so it is more friendly to search engines will help potential visitors find your site.
|