Valid XHTML


Is a valid page more optimised than an invalid one? The short answer: yes and no. Currently, it seems to depend entirely on which search engine is used. Some favour valid sites, but most barely acknowledge any difference in their rankings.

A brand new, perfectly flawless website would never rank higher than a well established invalid site on any search engine platform. There are many other equations to take into consideration before a search engine decides how a page should rank.

In all likeliness, something like 90% of the web is invalid. Should a search engine amend its alogorithm to prioritise its rankings based on a preference of valid sites to invalid ones, most of the Internet as we know it would be lost. The web would turn upside-down, and rankings would inverse.

But that isn't to say that validating your XHTML isn't important. For sure, search engines factor this into their equation, but the real question is how heavy does it weigh in comparison with other factors such as keyword density or inbound links?

If search engines ranked sites based purely on the quality of markup, then the valid site would win. Unfortunately, SEO isn't that simple. Valid XHTML helps, but is certainly not the only key.

What is XHTML?

From a developers point of view, Extensible Hypertext Markup Language is the same as regular old HTML but with a bit of XML thrown in for good measure. It is a mash of XML parsing principles and well-formed markup language. When a page is reffered to as valid, or to contain valid HTML, chances are XHTML is used.

Many developers have made the cross over to XHTML in order to keep up with industry standards and recommendations set by the W3C. Although regular HTML 4.01 validates just as easily, it does not render its content as standardised as XHTML does.

XHTML is a stricter and cleaner version of HTML 4.01, and becuause an XHTML document is processed as an XML document, it is rendered that way. When the web browser encounters a fault, it stops processing the code and displays an error. Sometimes these errors can be tricky to decipher, so use the W3C Validation Service to identify the error for you.

The basic difference in XHTML, is that it doesn't allow sloppy code. XHTML by its very nature must be strict otherwise it will not render. It might be said that XHTML was adopted to encourage good programming, but we need to know if search engines acknowledge this.

How do I validate my HTML/XHTML?

Go to The W3C Markup Validation Service. This free validation service offered by the World Wide Web Consortium scans your code for errors and imperfections. While seemingly flawless code renders cross browser without fault, the W3C validation service will pick up any errors and advise you on how to amend them.

The service validates your code one of three ways; by URL, file upload or direct input. However, validating by direct input forces the validator to assume UTF-8 encoding.