Optimizing Your HTML

November 1st, 2004


SEO can be broken into two distinct areas — “on-page” factors and “off-page” factors.

On-page factors include anything that you can affect on the page itself, such as the title tag, body copy, H1 heading tags, image ‘alt’ attributes etc.

Off-page factors encompass things that influence rankings but are not on the page itself, such as PageRank score and anchor text, better known by the layman as link text.

When you are optimizing the on-page factors, you start with keyword research to identify the keyword markets that you should go after. You revise and add content targeted around those keyword markets (content optimization) and you optimize your HTML templates so that the content that is contained within has its best chance to sing to the search engines.

Step 1 – Make sure each page can sing a unique song

The worst kinds of HTML templates have title tags and meta data like the meta description hard-coded to be the same across all pages that use that template. Make sure that your title tag, meta description and H1 heading tag can be assigned on a per page basis, thus unique to the specific page in question.

Step 2 – Strip out extraneous HTML code

Superfluous code in your HTML negatively impacts your search engine rankings by pushing your good keyword rich copy further down the page thus lowering keyword prominence. Because the search engine spider looks at the HTML code rather than the rendered page as you see it in your web browser, elements in the HTML code that bloat the page up will lower your page’s keyword prominence. In addition, this “bloat” will negatively impact the user experience as it increases download time. As you know, Internet users are notoriously impatient.

Superfluous HTML would include HTML comments, JavaScript code that is “inline”, cascading style sheets or CSS that are “inline”, — and table tags used for layout. Not only are tables inefficient for layout — they also offer poor accessibility because “screen readers” (software used by visually impaired users to read each web page aloud) will read out all that table information to the user as if it were a tabular data such as a chart. So strip out all the comments, move the JavaScripts and style sheets into separate “include” files (in the case of JavaScript, a .js file and with style sheets it is a .css file). So in effect you replace a many-line JavaScript or cascading style sheet with a one-line reference to an external file containing all that code.

Step 3 – Amplify the song that your content sings

Your content, when merged in with your HTML template, is what is served to the search engine spider. Your HTML template can squelch that song or it can amplify it. Above, we have already talked about ways that your HTML code can squelch the song. Now in order to amplify it, make sure that you include heading tags on your pages and utilize text navigation whenever possible instead of graphical navigation. For example, clickable buttons can be done as text but made to look graphical. Text links are much more effective than graphical links because the search engines take the link text that you have used and associate the word in the link text with the page that you are linking to. You will get a lift in your rankings for the keywords contained within those text links.

Step 4 – Not to worry about

The meta keywords tag doesn’t have much of a place nowadays in SEO, so you can safely leave that out of your HTML templates.

A meta robots tag with instructions to index and follow is unnecessary, as that is assumed, so leave that out as well.

Image ‘alt’ attributes used to be a lot more important than they are now. It seems nowadays that only when the image is also a link that the ‘alt’ attribute is actually paid any attention to by the search engine.

Taking all the above into account, you should end up with HTML templates that really enhance your search engine positions across all pages that they are applied to.