aaron-kelley.net

My little corner of the Internet

Archive for August 9th, 2009

WordPress – _wp_unfiltered_html_comment causing pages to fail (X)HTML validation

If you have a WordPress blog, and you log in, you may notice pages failing HTML or XHTML validation because of code like this:

<input type="hidden" id="_wp_unfiltered_html_comment" name="_wp_unfiltered_html_comment" value="xxxxxxxxxx" />

This code only shows up if you are logged in, and allows your comments to bypass HTML validation, so you can use whichever HTML tags you like.  What is causing the problem is the “id” attribute.  According to the XHTML standard, the ID must start with a letter, and here it starts with an underscore.

(more…)