Sunday, January 10, 2010

Search Engine Optimization (SEO)

Usually people thought of SEO (search engine optimization) once they are done with website. What I say is: You should be keep some of the points in mind before you start building your website. Here I will summarise some of the keypoints to be taken care of for better "Search Engine Optimization":

1) Add good descriptive content to your website. This will create keywords for search engine. Another tip that gets generated from this tip is: If you are using images to explain something in your website, don't forgot to 'alt' sub-element of 'image' element. In the 'alt' sub-element you can explain your the content of your image.

2) Try to reduce parameters in the URL, in any case you will need parameters in you url. So prefer to RESTful urls. Using RESTful urls will let you pass parameters without adding parameters in the url. For example: normal url >> www.website.com?uid=xxxxx&email=xxxxx@xxx.xxx and rest url would be "www.website.com/xxxxx/xxxxx@xxx.xxx" and your url handler component would actually grab uid & email and pass them to your controller.

3) Generally your url describes which page is being accessed. Prefer using hyphens instead of underscores in the long word in url. Following is the example how search engine would interpret the words in the each of the urls:
arnav-awasthi.html would be interpreted as arnav awasthi.html
arnav_awasthi.html would be interpreted as arnavawasthi.html

4) "title" tag of page: Your html page has a element "title". Use this element to define your page in fewer words. Search engines use this element to a great extent. For example if your webpage give weather report of Pune, you may give title of page as "Youwebsite: Pune: Weather report".

5) Meta tags: There are two meta tags which you can use to describe the content of your webpage. They are "description" and "keywords". You can take a look at any popular website how they have used these tags to describe their content.

By following these tips, you will be able to create a well illustrated website with clean search engine friendly urls.

So now you have created your search engines friendly website. It's time to collect all the public links of your website, put them together and hand it over to search engines. So here is a protocol which will tell you how would be collecting your links and how you can tell search engines about this url document.

You will have to create a sitemap xml. http://www.sitemaps.org/protocol.php tells you how your sitemap should look like.
Useful tip while you create sitemap: Stick to either www or non-www type of url.

Now I will tell you after creating sitemap, what else needed to be done and how would you do that.

Whenever search bot comes to your website, it first looks at the robots text file at the root of your website. This file tells robots where your sitemap xml is and which pages/directories it doesn't need to crawl. You can create a robots.txt file using google webmasters tools.

So here I summarise the steps after you have created sitemap.

1) update your robots.txt file. Add this line to your robots.txt: Sitemap: http://www.example.com/sitemap.xml

2) Submit your sitemap to the popular search engines. You can submit your sitemap to google, yahoo and bing.
a) Submit to Google: To submit the sitemap to google URL should be like this:
http://www.google.com/webmasters/tools/ping?sitemap="your sitemap's encoded url", or easy way is to submit your sitemap using google webmasters tools.

b) Submit to Yahoo: For submitting your sitmap to you need to generate Yahoo API key. Your final url would look like:
http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid="APPID&"url="your sitemap's encoded url"

c) Submit to Bing: For bing your url would look like:
http://www.bing.com/webmaster/ping.aspx?siteMap="your sitemap's encoded url"

After all these you are almost done. Now you can give some thought to canonical urls. As I have said that you must stick to either www or non-www form of url. Now it's the time to tell search engines which one you prefer. You can use your server redirect to do so. Like in apache you can use mod_rewrite to do a redirect every request to strictly to the one form (either www or non-www) of url. Apache: Redirect from non-www to www form is the link of my another blog post which tells how you can do that.

Start Using google webmasters tools: Create an account in google webmasters tools and add your website url to it.
1) Add both forms (www and non-www) of urls, it will generate piece of code which you should add into your html code. And then you can verify your website with google webmasters tools.
2) Tell google which url you prefer: Site Configuration > Settings > preferred domain.

Now you are done with search engine optimization. Do keep checking your website's performance in google webmasters tools.

1 comment: