If you would like to perform a Search and Replace in your MySQL Database without using plugins you can easily do that through phpMyAdmin, in this tutorial we will show how to perform that for WordPress Posts. The MySQL Search and Replace is particularly useful when changing the domain of your WordPress website.
* Note: If you’re not certain what your Database is you can find out that through your wp-config.php file
UPDATE `wpqw_posts` SET guid = REPLACE(guid, 'https://oldUrl.com/', 'https://newUrl.com/') WHERE `guid` LIKE 'https://oldUrl.com/%';
Performing this to replace https://example.com to https://newExample.com makes the following changes to the database
You might want to replace another Column’s Data for your MySQL Database, not only limited to WordPress’ Posts
UPDATE `MySQL_Table` SET `MySQL_Table_Column` = REPLACE(`MySQL_Table_Column`, 'oldString', 'newString') WHERE `MySQL_Table_Column` LIKE 'oldString%';
Doing a Search and Replace via SQL could be dangerous if you have links that you’re unaware of which shouldn’t be changed. You should Search and Replace only when you’re convinced that you have to change the text in your Database. You should always perform a Database backup before proceeding with any manual changes. This can easily be done through phpMyAdmin:
Get a new cheap cpanel hosting account with unlimited number of MYSQL databases. SSD MYSQL hosting on a greatly discounted price – 40% OFF the regular price – starting from $2.94/mo only!