8249 West 95th Street, Overland Park, KS 66212

Get Your Doctype Right or Your Validation Will Be Wrong

We investigate a lot of competitors for our clients all the time.  It’s a never ending process which is growing more advanced and in-depth all the time.  Home Depot is a competitor of one of our new clients and while investigating their site I was shocked to learn that their HTML validation was stupid-bad.  The W3C validation tool reported 8,386 errors and 5,262 warnings.  I knew that couldn’t be right because the site rendered quickly and correctly and still ranked for things.  I looked a little closer and noticed that the doctype set in their code was XHTML 1.0 Transitional and yet their code was HTML 5.  As you can see in the screenshots below, once the proper doctype was selected the validation went much better.

Auto-detect doctype brought up XHTML 1.0 which resulted in a huge number of errors.
Auto-detect doctype brought up XHTML 1.0 which resulted in a huge number of errors.
Manually selecting the doctype as HTML 5 made the validation go much better.
Manually selecting the doctype as HTML 5 made the validation go much better.

I think this shows pretty well that Google’s bot auto-detects the doctype from the actual code syntax – not from the listed doctype in the HTML. If the bot tried indexing this site with XHTML 1.0 they’d never get anywhere because of all of the syntax errors.  Kind of makes me wonder… is Home Depot getting a pass on this?  Must be time for an experiment.

Also, it’s another example of a webamatuer involved with a major site. They might check compiled code syntax on the backend, but don’t ever bother checking the live output’s validation.  It only takes a second and two more to paste in the proper doctype.  Come on guys…