Validate XHTML before you post


Following up on an old article form Jesse Ruderman I wanted to have a way from within WordPress to validate XHTML through the Quicktags buttons. I rewrote the “Bloggidate” set of hacks to work from within WordPress.

So this will let you validate the content of your post before you actually post it to the blog to ensure things do not ever break in terms of validation. Just type in the post and click on validate from the quicktags.

The installation is relatively simple and I have included functions for both XHTML 1.0 Transitional and XHTML 1.0 Strict.
You can download the instructions from here:
PS: Tested and working in both FF and IE

Again, much of the code comes from Jesse Ruderman, so thanks go out to him.




  1. David Blangstrup (2 comments.) says:

    Sorry, I can’t find it in the quicktags.js — where should I go look for it?

  2. PlanetPhillip (1 comments.) says:

    Work perfectly. Thank You

  3. David Blangstrup (2 comments.) says:

    How come it’s validating in utf-8 when I use iso-8859-1?

  4. Mark (34 comments.) says:

    Its part of the validate code. Look for the s=’ variable and replace with 8859-1 DTD

  5. Jax (1 comments.) says:

    Is there any way of hooking this up to the comments form so that comments can be valid XHTML? I can make my site validate, but I don’t want to manually edit each comment so that it validates. A plugin to do that would be great.

  6. Mark says:

    Looks like not much has changed in the 1.2 Quicktags structure. This should work in the latest 1.3 as well.

  7. Craig (19 comments.) says:

    Is this for WP 1.2, or will it work with one or more of the 1.3 Alphas currently floating around?

  8. yoli (1 comments.) says:

    Will this work for v 1.5 as well? That would be very nice if it did! I was able to insert the first part of the Javascript without any problems but they’ve changed how the dictionary code is written and it’s not as you’ve noted in the .txt file. Since I don’t really know Javascript I’m afraid to the code.

  9. BillyG (6 comments.) says:

    I updated to WP2.0.3 yesterday and added this code again (I’ve been using it for several months with great success) but now the button doesn’t appear on my panel. Is anybody else having the same results? TIA.


  1. […] d valid. Not any more, first off we have LaughingLizard’s spankin’ new hack tovalidate your posts before publishing. Alright, so that is a […]

Obviously Powered by WordPress. © 2003-2013

page counter