joeware - never stop exploring... :)

Information about joeware mixed with wild and crazy opinions...

WordPress sites working incorrectly with Windows Live Writer (WLW)

by @ 7:06 pm on 10/21/2011. Filed under tech

As some of you may have noticed over the last few weeks as I found time I was posting test posts to the blog after several of the most recent "real"[1] posts got FUBAR’ed after posting and I wasn’t bright enough to go back and look at the post right away to validate that it had indeed posted properly. This resulted in completely confusing posts that required people to email me to say, hey dude, your blog is all dorked up, you might want to check into that.

Anyway I worked out the problem… finally. Certainly it wasn’t as easy as I thought it should be. Well the fix itself was simple, finding it was another matter entirely. I just didn’t seem to hit on the right combination of search words that didn’t result in post where someone was describing the issue and some bright person was telling them they didn’t know what they were doing.

The issue I was seeing was that HTML tags in Windows Live Writer (WLW) were getting half way sort of stripped. Specifically the opening and closing, ummm brackets? braces? The less than symbol (<) and the greater than symbol (>). The most common issue was the paragraph tag was getting changed from <p> to p and the end paragraph was changing from </p> to /p. Obviously that plays a bit of havoc with the formatting when a browser is trying to render the page.

I wanted to post this so hopefully all of the other people I found out asking the same questions I was asking could get the solution, which is remarkably easy.

So without further adieu… The issue with the partially stripped HTML tags is a bug in libxml2. Specifically using anything less than PHP 5.2.9+ with libxml2 2.7.3+ is susceptible.  The fix is to install a plugin into WordPress called LibXML2 Fix which you can get from your plugins menu or look here -> http://wordpress.org/extend/plugins/libxml2-fix/

 

For more detailed info see http://core.trac.wordpress.org/ticket/7771

 

Oh… How do you know what version of PHP and LibXML2 you are running you ask? Well you can ask your admins or you can look for an info page on your provider’s web site. But, as I found with my provider, they neglected to update their page so I found you can add the following PHP script to your website and just run it by calling it from a browser and it will tell you all about your PHP Installation.

<html>
<head>
<title> PHP Info</title>
</head>
<body>
<?php
phpinfo( );
?>
</body>
</html>

That will give you something that looks like:

image

which will go on and on with info for you. The main things you need to look at are the version of PHP

image

and the version of libxml2.

image

 

As soon as I applied the libxml2 fix plugin I was able to upload posts from Windows Live Writer with no issue.

I hope this helps someone else. 🙂

 

    joe

 

[1] The use of the word real does not in any way shape or form imply quality, suitability, accuracy, or safety to use in any environment whether test, production or otherwise.

Rating 4.00 out of 5

4 Responses to “WordPress sites working incorrectly with Windows Live Writer (WLW)”

  1. pslager says:

    I have been struggling with this for 6 months, installing the plugin fixes posting from live writer and MS word. Finally!!!!

  2. Rajesh says:

    You are kind and genius!!! thanks for sharing this fix. I was strugggling to put my firstever blog on my site but this helped.

  3. d.s.Levy says:

    If it was possible to reach through my computer and hug you, I would. Thank you, thank you, thank you! You’ve prevented me from having to find a new client.

  4. Eric says:

    I had spent the entire morning today fiddling with this problem. Everytime I published a post with Live Writer the html came out all messed up. After switching around Live Writer options and updating WordPress it was still happening. Even if I copied the correct html from Live writer and pasted directly into the online wordpress editor it didn’t work because the pictures in the post weren’t showing up. So finally I gave up and used the online editor to post which took forever. Later I decided to try again and googled “windows live writer messes up formatting”. Your post was the last hit and this fix worked! Thanks a million!

[joeware – never stop exploring… :) is proudly powered by WordPress.]