Optimizing HTML Source Code

Optimizing HTML Source Code

In the age of broadband internet access, it can be somewhat easy to forget about optimizing for lower bandwidth visitors. Many people these days use DSL or Cable internet access, which is many times faster than that of "dial-up". However, there will always be a need to optimize since there will always be somebody with slower than average internet access.

Not only is optimizing HTML good for your visitors (see: "Page Loading Times"), but it can also be good your rankings, since optimized HTML code will reduce the "noise" and increase the density of valuable content. The valuable content is the one of the most important components of good search engine rankings, so why don't you do yourself a favor and optimize your website with the tips below.

HTML Code Optimization Tips:

1 - Javascript & CSS
Most modern websites use Javascript and CSS ("Cascading Style Sheets"), both of which are a "godsend" to web developers. The only problem with these is that search engine spiders are not capable of interpreting these formats on the same level as a web browser. For this reason, you will want to put any such code in an external file so that it does not introduce complications for search engines. Even though many people tell you to copy and paste the code between your tags, it can more often than not be pushed into an external file and "linked to" from within the HTML code itself. The benefits of doing this are obvious: your valuable content is brought closer towards the top of your HTML code, thus it can be seen more readily.

2 - Nested Tables
"Nested Tables" are those tables which lie inside of others. These are quite common, but can more often than not be avoided, particularly with the more basic designs. The more nest tables you have, the more difficult it will be for both browsers and search engines to read you web page, so keep nest tables to an absolute minimum. Use cells instead wherever possible.

3 - Unclosed / Excess Tags
Most tags have an opening statement (e.g. ) and a closing statement (e.g. ). If you are using tags which are not properly closed or exist for no reason, then it will become extremely difficult for your page to be read by search engines since they can "choke" on these errors. Be sure to validate your HTML code using the W3C validity checker to uncover errors.

4 - "Invisible" Attributes
In the context of this document, these "invisible attributes" mean anything which cannot be seen by the user, e.g. the ALT's for images. Do not put excess data in these since these attributes will rarely help you obtain better rankings or improve anything else. They will just bloat your page size.

5 - Blank Spaces & Carriage Returns
Many people use an "HTML Editor" such as that available from CoffeeCup. In order to format the HTML code so that it can be more easily readable, several "white spaces" and "carriage returns" (also knows as "line breaks") are sometimes inserted automatically by editors. These are generally not of great concern, but check your HTML code to ensure that there are no unnecessary breaks / spaces for several lines. Each tab / line break or space will save you one byte of data, and in some instances up to 10% or more can be saved. That may not seem like a lot, but we are talking about optimization here and every little byte counts!

Rate This Article

You must be signed in to rate articles.