As part of my experiments with social media sites I came across the iBlogStats site. Its a great external dashboard for your blog, but it gave me a nasty shock by highlighting I had about 50 xHTML validation errors on my homepage!
Over the past month I’ve found that my posts have consistently had 40 to 50 validation errors before I manually hunt them down and resolve them. All of the posts were published using a combination of Windows Live Writer (WLW) and Wordpress. While I find them to be very easy to use the lack of quality in the output (and the effort required to repair it) made me wonder whether I’d chosen the right platform for my blog.
Some of the errors I was experiencing:
- paragraph end tags with no begin tag
- div tags surrounded by paragraph tags
- attribute construction errors where a title attribute had been moved within hyperlink, and had been concatenated with the href attribute instead of relocated after it
- img tags that weren’t properly terminated
… and the list goes on. To make matters worse I couldn’t resolve the errors directly in the Wordpress online editor because it insisted on converting div tags to paragraph tags, destroying the visual style of the posts in the process! I had to maintain a copy of the original post HTML elsewhere, edit it in a text editor then paste the repaired HTML over the existing content shown in the Wordpress editor. A rather tedious process.
A little time on Google found some tips that have dramatically improved the quality of automatically generated xHTML:
- Turn off the visual editor in Wordpress:
(via Weblog Tools Collection and More than scratch the surface)
In Wordpress’s admin interface, switch to the users tab and edit your current user. Uncheck the "Use the visual editor when writing" option. This resolves the "div converted to paragraph tag" issue mentioned above, and various other errors introduced when Wordpress "fixes" your HTML, so validation errors can now be repaired online. - Configure Windows Live Writer to publish xHTML:
(via whateverblog)
Windows Live Writer did such a good job of detecting my blog settings that I didn’t even think of manually configuring it to publish xHTML. How embarrassing! In WLW select the Weblog\Edit Weblog Settings menu item. Open the Advanced configuration options pane. Make sure "Markup Type" is set to XHTML. - Be careful where you "Insert Tags"
If you use the Web Layout view to write your post, be careful where you call the "Insert Tags" feature. WLW uses paragraph tags and non-breaking space to add blank lines to your post. If you are not careful you might insert your tags after a non-breaking space on a blank line and inadvertently wrap the tag’s div directly within paragraph tags. When you validate the results this will be highlighted as an error.
While some errors remain the volume is more manageable (a couple per post) and they tend to be easier to resolve. The most painful one remaining is the "attribute construction error" but it is looking more and more like this has been introduced by one of the plugins I’m using. I’ll continue debugging my configuration and report back if I ever manage to track this last major bug down!
Print This Post




