Sorry this site requires JavaScript to be enabled in your browser. See the following guide on How to enable JavaScript in Internet Explorer, Netscape, Firefox and Safari. Alternatively you may be blocking JavaScript with an advert-related or developer plugin. Please check your browser plugins.

In case you ever need to find and replace a text string in every post or page of your Wordpress site, this SQL code will help you out. I recently had to move a client’s website from staging into production, and just when I was getting ready to publish the new site I realized Wordpress’s HTML editor had hard-coded the URLs of every image in every post to the address of the staging server.
Comments4 Comments  

Comments

Avatar
from g1smd 1206 Days ago #
Votes: 0

Design flaw. It should use root-relative URLs, or have the domain name and base image path in a variable.

Avatar
from itcn 1206 Days ago #
Votes: 0

I would agree, putting that in a variable seperate from the main Wordpress site URL would be perfect.

Avatar
from 1witness 1204 Days ago #
Votes: 0

Great post Barry, I love your stuff!Ty

Avatar
from itcn 1204 Days ago #
Votes: 0

Thanks, Ty!

Upcoming Conferences

Search Marketing ExpoSearch Engine Land produces SMX, the Search Marketing Expo conference series. SMX events deliver the most comprehensive educational and networking experiences - whether you're just starting in search marketing or you're a seasoned expert.



Join us at an upcoming SMX event:

Upcoming Webcasts

Search Marketing Now Learn more about search marketing with our free online webcasts and webinars from our sister site, Search Marketing Now. Upcoming online events include: