Which DOCTYPE to use for WordPress Themes?

I received some feedback on one of our Carrington themes recently, letting me know that while we were declaring the DOCTYPE of the theme as XHTML 1.0 Transitional, it would be simple to go to XHTML 1.1 Strict based on the markup in the theme.

This didn’t surprise me, we always code to pretty strict web standard best practices at Crowd Favorite so XHTML 1.1 compatibility is generally just a matter of a tweak here or there. However, just because it’s an easy change doesn’t mean it’s a good change.

The main reason we choose to use XHTML 1.0 Transitional for our WordPress themes is simple: we have no idea what someone might decide to do with it. 🙂

It doesn’t matter if the theme validates strictly if the content doesn’t – and with all of the great tools and widgets available for WordPress, it’s pretty easy to add something that breaks your strict validation.

This is something you should consider if you’re a theme developer. Don’t just think about the code you’ve written to build the theme, think about what people using your theme will be doing with it; and make the best choice you can.