SEO seems to be a subject surrounded by both myths and varying opinions. Nevertheless, I would like to know if you have an opinion on how important it is to have semantically correct XHTML, that is, well-formed and valid XHTML, with regards to SEO.

  • Semantic means using the right tags where they are needed. For example using <blockquote> instead of <div class="quote">. It has nothing to do with validation.
    – Alin Purcaru
    Dec 2, 2010 at 15:19

6 Answers 6

  1. Well formed (x)HTML means there's less of a chance that the crawlers will incorrectly parse your documents. Poorly written (x)HTML leaves the possibility open that the crawlers either cannot interpret, or misinterpret your page's content causing the page to not be indexed or to be indexed incorrectly (to your detriment).
  2. The clues given by (x)HTML is a very large part of ranking algorithms. It's a big reason why flash isn't ever going to be as SE-friendly as(x)HTML. It simply lacks the ability to give strong clues to the search engines about the page's content (notice I didn't say Flash couldn't be crawled or indexed). For example, <abbr title="International Business Machines >IBM</abbr> tells the search engines that IBM is short for International Business Machines. This helps them associate the two. (Not coincidentally this is also good for users).
  3. Page speed matters. Poorly writtn (x)HTML means it will take longer for your pages to render. If your pages take too long you run the risk of having your pages penalized (you need to be in the bottom 1% for this to happen and poor (x)HTML won't do this on its own but when combined with other factors it certainly doesn't help you in this respect).
  4. If your (x)HTML is properly written you can take advantage of microformats. But if you can't get your (x)HTML to format properly you certainly aren't going to get microformats to work for you.
  • Good answer. I'd add some perspective in that it's obvious by looking at Google search results that this is not a very important factor -- Google cares about users, so other user-centred factors (rather than technical factors) are more important. The goal of total validation is a misuse of resources (the time could be spent more effectively improving other factors that will make the site more effective in search engines). Dec 3, 2010 at 1:25
  • +1 for point #4. IMO microformats provide more valuable metadata than any semantic data included as part of the xHTML formatting, and this is pretty well demonstrated by the information now shown by Google in search results (see recipes, especially). Dec 3, 2010 at 4:37

Some search engines will give you penalty points for mismatched doctypes, encodings, botched HTML, etc...

  • 2
    I'd love to see a source for this <strike>(mis)</strike>information
    – John Conde
    Dec 2, 2010 at 15:31
  • @John For example seznam.cz will ignore your pages if they have different encoding then they claim and only supported encodings are UTF-8, iso-8859-2, windows-1250 Dec 2, 2010 at 15:37

If you want your XHTML to be properly parsed and "well understood" by the search engine crawler/indexer, then yes...it is important.

The major search engines should be able to handle minor issues but those types of mistakes may or may not hurt your ranking depending on which search engine you're talking about.

  • Thanks for your answer. Do you know if there are any well known sources that state this?
    – Clean
    Dec 2, 2010 at 15:18

Not only does it help the search engine "understand" your content, usually correct code is less obtrusive and therefore makes up less of the page. At least with Google, your code to content ratio affects your score, so it's another vote for good clean (minimal) code.


You should try to write semantic and valid XHTML even without regards to SEO, as it helps to keep your code clean.

As for search engines, Google uses very complex algorithms to rank your site, and validity & semantic code will definitely be amongs them. Nobody except for Google can tell you exactly how much does it matter, but it will definitely help.


Since the question was how important, tha answer would be it is of minor importance, as long as your code is not a validation nightmare

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.