WordPress.org

Nice Trick to Clean Old Entries

Posted October 29, 2003 by Matt Mullenweg. Filed under Development.

Mike has posted a great SQL trick to the forums. Old versions of b2 would naïvely enter break tags (<br />) into the database, often breaking block-level code posted or just making formatting awkward. Now that WordPress has the autop function to intelligently add line breaks what do you do about all of your legacy b2 content? Mike (who has entered his sixth month of not smoking, congrats!) offers this quick query:

UPDATE wp_posts SET post_content = REPLACE(post_content, '<br />', '');

Of course you should always backup your database before doing such an operation.

No Pings

RSS feed for comments on this post.

  1. Don’t forget to run it on wp_comments too.

    Comment from mike on October 31, 2003

See Also:

For more WordPress news, check out the WordPress Planet.

There’s also a development P2 blog.

To see how active the project is check out our Trac timeline, it often has 20–30 updates per day.

Categories

%d bloggers like this: