WordPress: Quickly Replace Content Across All Blog Entries

I discovered I could change my image paths that were linked against www.techish.net to www.techish.net by using MySQL to REPLACE the string.
After a few minutes of thinking about this, this is a really cool thing — beyond what I just accomplished.
I can use this to update what was once static information (phone number, fax, email, contact information, etc.) quickly!
This is what the syntax looked like:

update blog_posts set post_content = REPLACE(post_content,'https://techish.net/wp-content/uploads/', 'https://techish.net/wp-content/uploads/');

Now using that as a basis, I can use REPLACE(post_content, ”,”) to create quick hacks to change emails on-the-fly that were contained in my posts.

Published by

Rich

Just another IT guy.

Leave a Reply

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