WordPress.org

Ready to get started?Download WordPress

Forums

Update hard coded image url in post content (3 posts)

  1. chitaranjan.thoudam
    Member
    Posted 5 months ago #

    Recently I regenerated the thumbnails using "Regenerate Thumbnail" plugin after modifying the plugin to delete old thumbnails. All went fine, now old thumbnails has been deleted and I can see the new ones.

    Now the problem I am seeing is there are post which has hard codes images, example as below image url http://nezone.info/wp-content/uploads/2013/11/OSA_Football01-580x385.jpg. Since old thumbnails has been deleted image is now not showing in the post. I can see those post using this sql query:

    SELECT *
    FROM wp_posts
    WHERE post_content LIKE '%-%x%.jpg%'

    I am wondering how we can update the above url as http://nezone.info/wp-content/uploads/2013/11/OSA_Football01.jpg

    I tried with below query which comes out as "0 rows affected", so wondering any one of hack can provide me a solution.

    UPDATE wp_posts SET post_content= replace(post_content, '%-%x%.jpg%', '%.jpg%')
    WHERE post_content LIKE '%-%x%.jpg%'

  2. Andrew
    Forum Moderator
    Posted 5 months ago #

  3. chitaranjan.thoudam
    Member
    Posted 5 months ago #

    Thanks @Andrew Nevins for the suggestion.

    Search Replace has been powerful tool for any search and replace, I have been using this a lot but unfortunately this does not work when I use wild card.

Reply

You must log in to post.

About this Topic