XHTML to HTML WordPress plugin
At last there is a new version of this plugin. This version is no longer supported. Please download the new version.
This tiny plugin filters WordPress’s output to produce HTML instead of XHTML. It is simple to use and will ensure that your WordPress Blog stands at least a fighting chance of being properly standards compliant.
The WordPress platform is based with the best intentions, from boots to brow, on XHTML and has been ever since I’ve been using it. Now this is a shame really because that single fact may be preventing your Blog from being properly standards compliant.
Put your hands up if you are running a blog that serves documents using a MIME type of “application/XHTML+XML”? What’s that deathly silence I hear – what, nobody is doing that? Then in that case nobody (regardless of what doctype you are using) is serving proper XHTML and worse, no one is running a standards compliant website. Perhaps even worse still, you probably shouldn’t even try to use an XHTML MIME type on your website either. Now I bet you didn’t know that.
The vast, vast majority of people whose blogs are served as MIME type “text/html” should be using the HTML 4.01 doctype rather than XHTML. The issues surrounding this problem are considered unfortunately rather technical so I will endeavour to write a lay person’s guide to the subject soon, covering the issues a bit more simply than they’re are in most places I know of.
In the meantime there is a very good article by WebDevout about this which is worth reading.
What The Plugin Does
XHTML to HTML is a simple output filter that translates XHTML documents into valid HTML 4.01.
Do I need to write in HTML now?
No, you don’t have to change a thing. All your carefully coded XHTML will translate into pristine HTML 4.01 seamlessly. Remember, WordPress is an XHTML platform – all headers, plugins, themes and filters assume you will be using XHTML as the output Doctype. Whilst this is, technically, wrong (unless you use the right MIME type) you can continue to write in XHTML if you want to. However, you could alternatively switch to writing in HTML 4.01 instead. You do not have to write sloppy hard to read code, keep your tags lowercase if you like, close your tags a’ la XHTML, use a DOCTYPE etc. because that’s all valid HTML too!
- Download the plugin using the link above and extract the ZIP archive onto your computer somewhere.
- Copy the folder “XHTML-to-HTML” to your /wp-content/plugins/ folder
- Activate the plugin in WordPress
- That’s it!
The plugin really does very little, which is not a bad thing for an output filter. It has no bugs I’m aware of, but suggestions for improvements are always welcome.
- Microsoft browsers do not support XML (XHTML is a type of XML). IE7 has limited support but lower versions have none whatsoever. So, unless you’d like to banish that audience from your blog you can’t even consider trying to use XHTML properly – that is, by using the correct MIME type.