WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found a way to export my posts in text form so that I can move them to a blog with static pages. The only problem is that there are no paragraph tags, so every post is a huge block of text. I had been using line breaks and relying on wpauto to add paragraph tags automatically.

Is there any way to add those tags into my posts without doing it by hand?

share|improve this question
up vote 2 down vote accepted

a quick and dirty way to do this is by running this ONCE:

global $post;
$posts = new WP_Query();
$posts->query(array('posts_per_page' => -1, 'post_type' => 'post'));
while ($posts->have_posts()):
  $post->post_content = wpautop($post->post_content); // replaces new line chars with <p>'s
  wp_update_post($post); // updates the database

(didn't test it)

But how are you exporting your posts in text form? Maybe you could apply the autop filter in your export routine

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.