Forums

Find and replace in database (3 posts)

  1. roamingk
    Member
    Posted 4 years ago #

    Hi,

    I recently moved from S9Y blog to WordPress. I did an import from an XML feed. Year 2 and 3 posts are perfect, however Year 1 posts are missing photos due to the way the XML feed was formatted. Quotation marks have been marked up as & q u o t; *without the spaces* so any img src="XXX.JPG" appears as img src= & q u o t; XXX & q u o t;

    Is there an easy way to "find and replace" this using PHP My Admin in the wp_posts table.. as this is not my forte..and I don't really fancy having to edit 200 posts by hand. I know I could reformat the XML feed, but that would be just messy.

    K.

  2. Austin Matzko
    Member
    Posted 4 years ago #

    Yes, but as with every direct database operation, there is some risk, and you should have a backup already.

    UPDATE wp_posts SET post_content=REPLACE(post_content, 'src="', 'src="');

  3. moshu
    Member
    Posted 4 years ago #

    There is also a handy plugin named (you guessed) "search and replace".
    http://wordpress.org/extend/plugins/search-and-replace/

Topic Closed

This topic has been closed to new replies.

About this Topic