The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

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

  1. chitaranjan.thoudam
    Posted 2 years 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 Nevins
    Forum moderator
    Posted 2 years ago #

  3. chitaranjan.thoudam
    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic