Mass update WordPress content in MySQL

Here’s a quickie that may help someone someday.  If so, yay, I helped!

When I migrated my blog most recently I must have screwed something up along the way and some old posts had all image URLs replaced with a now bad IP address instead of a fqdn.   I crafted up a SQL statement that was able to update a ton of posts all at once.  Gotta love efficiency.

This does a search and replace on every post (post_content field within the posts table) and replaces the first snip with the second.  Neato.

 

 

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *