Every search engine optimization (SEO) guru would advise you that you need to keep your site XHTML transactional so as not to miss out in the search engine ranking. Why? If there are errors in your pages, search engine bots could skip part of or the entire page during their indexing.There are broadly two ways that your pages can be broken.
- Your theme doesn’t produce valid XHTML, and
- You or your readers may enter invalid XHTML content.
Nowadays, most theme authors ensure their theme to be XHTML transactional. Needless to say, if you edit templates, you run the risk of damaging the page’s integrity. If you add a new widget, you may also invalidate the entire site, for instance, mis-configuring the widget (e.g. missing the title of the widget). Some theme may not be fully widget ready, e.g. allowing only one instance of a widget (due to poor ID assignment). Once you make such changes, you need to run the XHTML validation tool over your site. W3C kindly offers such a free service at http://validator.w3.org/
Under “Options” -> “Writing”, WordPress has an option “WordPress should correct invalidly nested XHTML automatically”. By default, this is unchecked, because it makes things worse if you write HTML code in the post, say, inserting a widget code. Most bloggers prefer leaving it unchecked. Invalid content could get in your blog without notice. Comments too may contain bad HTML code. The best tool in the trade is WordPress XHTML validator by Rudd-O, which you can download here. You need “xmllint” (part of libxml2) or “tidy” to run the validator. Once you downloaded it, drop it into your wp-content/plugins directory, activate it, and execute it under “Manage” -> “XHTML Validator”. The validator will go through all posts and comments in the database and report its findings.