Update hard coded image url in post content
-
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 https://nezone.info/wp-content/uploads/2013/11/OSA_Football01-580×385.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 *
FROMwp_posts
WHEREpost_content
LIKE ‘%-%x%.jpg%’I am wondering how we can update the above url as https://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
SETpost_content
= replace(post_content, ‘%-%x%.jpg%’, ‘%.jpg%’)
WHEREpost_content
LIKE ‘%-%x%.jpg%’
- The topic ‘Update hard coded image url in post content’ is closed to new replies.