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.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.