I am testing blogging from Word 2007, so we can support users who wish to do so. Everything works fine, and as expected except the plugins that we use that add filters to the_content (eg wordpress-table-of-contents) do not process the posts from Word.

If you open the posts in WordPress & save everything works fine, even if you do not change anything, but we want to be able to avoid this.

For information, the site I'm most concerned about here is an MU site (running WP 3.0.1), but non-MU sites are affected in exactly the same way.

So is there a way to have these plugins process posts that come from Word that doesn't involve interacting with the Wordpress admin panel?

  • How do these files that "come from Word" actually make it into WordPress without the user entering them at the WordPress site? – MikeSchinkel Aug 19 '10 at 16:20
  • What filters are you hooking to? Can you post one of your functions that fails to modify the_content? – kevtrout Aug 19 '10 at 23:53
  • @kevtrout - Ah, very nice. Looks like MS scarfed some code from Windows Live Writer which is a great bit of software itself. Unfortunately I don't have Office 2007 I'm running a Mac these days (though I don't love it.) – MikeSchinkel Aug 20 '10 at 0:12
  • @sjcockell - And chance you could post provide the database for a fresh install of WordPress with a post that exhibits the problem? Or worst case the HTML of the post that is causing the problem which you could post to gist.github.com. If so I'm sure we can identify a fix. – MikeSchinkel Aug 20 '10 at 0:14

You could use TinyMCE Advanced, which has a 'paste-from-word' button that you can add to the editor. It doesn't so much make Word posts useful, as make them 'not Word'.

  • This requires that users log in to the Wordpress site though, which is what we want to avoid. We would like to enable publishing from as many 3rd party clients as possible, and have them all work the same. – sjcockell Aug 19 '10 at 13:49

I'm not 100% sure, but I believe the content_save_pre filter runs for posts created via XML-RPC (not just the admin area). You can use this filter to strip out all of Word's excess HTML (using kses for example).

  • Isn't there some hooks that work with anything XML-RPC? If not, let's write a quick patch, should be easy to implement. – hakre Aug 27 '10 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.