WordPress: Quickly Replace Content Across All Blog Entries

This content 9 years old. Please, read this page keeping its age in mind along with the fact technology changes fast and the information on this page me be outdated, not best practice, or plain wrong.

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.

Speak Your Mind


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