SEO basics for html coding

We always concerned about the layout/design while developing a html template, but it should be in practice always to put the best code. Here i am writing some steps that we should follow…

1. you must defined the doctype at the beginning of the code.(xhtml strict is best)
2. you must use the title tag, page title text should be within 80 characters
3. define the meta characterset, keywords, description. meta keyword’s length should be within 150 characters and description’s length should be within 800 characters. text should be meaningful in title and description without repetition.
4. include the style sheet/css file, dont use inline coding like

<style type=”text/css”>
body{
…..}
</style>

5. include all js file, dont insert inline coding again.
6. if you’ve used any images for menu, load the images while window is loading using javascript like

<body onload=”javscript: LoadMenuImages();” id=”home”>

where LoadMenuImages will load the images.
7. use div instead of table as loading div is faster than table and its quite meaningfull.
8. if you have used xhtml, you must close all tag. that is

<br> is wrong
<br /> is right

9. Use title and hyperlink that is

use <a href=”#” title=”people”>people</a>
instead of <a href=”#” >people</a>

10. use alternative tag, title on images.
11. dont use any inline javascript or style like <img style=”border:0″ />, instead use class.
12. make documentation for any div.
13. if you have any object like flash, applet – try to implement them using javascript and make sure
they are cross browser compitable.
14. make sure, all of your content can be accessible via text browser
http://www.vordweb.co.uk/standards/download_lynx.htm
its very important, because search engine’s bot can access your site exactly like text browser’s view. so if you have any flash object, applet – use alternative code for text browser.
15. if you need to insert google analytics code, insert it just before </body> tag, like

<!–google analytics start –>
<script src=”http://www.google-analytics.com/urchin.js&#8221; type=”text/javascript”>
</script>

<script type=”text/javascript”>
_uacct = “UA-3673301-1”;
urchinTracker();
</script>
<!– google analytics end –>
</body>
</html>

16. implement code in a way such that your site can be access only using keyboard.
17. make sure your html, css are w3c validated. Make your code atleast WAI A validated.
http://www.cynthiasays.com/
18. make your code clean and tidy, remove any unnecessary break line(

<br/>

) or others, dont insert empty div.
19. site should have a sitemap from where visitor can go any portion of your site.
20. use table if any form.
21. if you want to not to be cache a page on search engine, use following code and meta tag portion

<meta name=”robots” content=”noindex,nofollow” />

can’t remember more, that’s for now.

Advertisements

6 thoughts on “SEO basics for html coding

  1. Also- you need to decide if you want a www or nonwwww website. You can use canonical tag like this: link rel=”canonical” href=”” or a simple 301. www and nonwww are considered duplicate content. Please also remember does index.htm load? index.html? default.asp? index.php? what about simple domain.com/ ?? What page do you want for your home page? Even if these load to a blank page then this is a problem.

    content is the key to seo– the more content you have.. the best- the reason why we want to use div tags is because there is a code to content ratio in SEO.. I can go on for days..

    • Thanks Joseph. Actually i wrote here the html coding styles beside SEO. There are more things related with SEO that i forgot at that moment like h1, h2 tags, keyword density, backlinks, duplicate content etc etc. There will be more post on those stuffs.

    • Hi Saiful,
      Thanks for your complement. There are many things for SEO stuffs such as content distribution(page title, meta description, keywords, contents, content headers[h1, h2, h3..], links, http headers, link errors, page load, sitemap submit, link building etc etc. i wrote only html coding issues and its need to update more. More postings on SEO will come soon, so hang tied!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s