Question

I posted this question on wodpress.stackexchange.com without getting any response.

I realized it could be a programming issue in PHP.

I am trying to publish a blog post into wordpress based website from Microsoft Live Writer. Here is the sample text that I added in Microsoft which I published as well.

" Temporary Blog Post
I am adding a temporary blog post here 
Let’s see how it goes
Thanks"

However, when I published the post, this is how it looked

/pI am adding a temporary blog post here
/ppLet’s see how it goes
/ppThanks

Notice the \pp tags which is getting added in text.

Any idea the reason behind the formatting error? I thought when you publish from Microsoft word or Microsoft Live Writer, it should look the same as in the Microsoft Word/Live Writer.

Update : I am having the same error when I am posting from other publishing software like Windows Live Writer etc.

Was it helpful?

Solution

By default, WordPress automatically inserts paragraph tags all over the place when displaying ‘the_content’ – this often gets in the way when you’re trying to space out your text, and also creates validation issues (inserting implicit p tag). If you want to strip the automatically inserted paragraph tags from your content, simply insert this line in your template file above ‘the_content’ tag:

<?php remove_filter (‘the_content’, ‘wpautop’); ?>

OR

Use the cleanup_shortcode_fix() function that should help with your issue.

Check out below links for more information,

  1. Remove the p tags auto wrap
  2. Removing <p> and <br/> tags in WordPress posts
  3. wordpress-wrapping-shortcodes-with-p-tags
  4. Disable wpautop

may this help you.

OTHER TIPS

I found this article which seems to deal with the problem, although its very old so my initial question would be what version of wordpress are you using?

To stop wordpress adding the tags simply add:

   remove_filter ('the_content', 'wpautop');

To the top of your functions.php

On a side note I don't use the auto publish features of word, I find cut and pasting a document into Ultimate TinyMCE is the best way to keep your formatting, but thats just my opinion.

Paste it in the notepad first then recopy it from the notepad before pasting it to the wordpress editor.

That should do it.

OR if you dont want to use notepad,

There's a button in the editor that allows you to paste content directly from Word. This removes the special formatting Word uses to lay content out on the page and will make things work well on your site. (The button is in the "Kitchen Sink" on the Visual editor and is circled in the image below.) alt text

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top