Often, you will need to search and replace words or parts of your WordPress site for any of the reasons as:
These are a few scenarios where you may come to need a feature to “search and replace”, but okay if your scenario is a bit different from the mentioned above. No matter what the scenario, look for each file and search manually is a tedious job that anyone would want to do. Fortunately for us, there is a faster and more efficient way to replace things in your WordPress site. One of the biggest disadvantages, however, if you make a mistake during the process of search and replace, you can not reverse the changes. Then consider Create a backup of your WordPress website before proceeding to thus prevent serious data loss.
Table of Contents
Option 1: Using a plugin
The plugins make the life of a WordPress site owner easier every day. If you do not have any experience with website development or do not intend to go through the pain of performing SQL queries, then you can use plugins like going to your WordPress admin panel by navigating to the session Plugins → Add New
In the search field, between Better Search Replace and install.
Click Enable when finalizing facilities, and the plugin will be ready and implemented. You will find it in the session → Tools Better Search Replace
Next step, you need to put the information you would like to change:
If you run the plugin without the simulation option, it immediately updates your changes in your database and you will see similar results:
Congratulations! You could edit all entries in your WordPress database using a plugin.
You can also perform a search operation using phpMyAdmin , which is usually located in the hosting control panel.
If you have many databases on your account, you open the file wp-config.php to find the database name that your site uses.
When you enter phpMyAdmin, select the database that WordPress uses and click the tab SQL .
This is the query syntax that you use to perform the operation:
table_name update September FIELD_NAME = replace (FIELD_NAME, "Text to search, 'text to replace it with');
For example, if you want to update the table of posts, you could accomplish using this research:
wp_posts update September post_content = replace (post_content 'Find this text,' 'Replace it with this');
Note: wp_ should be replaced by the appropriate prefix used by the tables of your WordPress database.
When you have completed the survey, click the “button Go “.
After a few minutes of the process, you’ll see exactly how many rows were affected.
Good job! You learned how to manipulate the information in your WordPress database using SQL queries in phpMyAdmin.
Perform most things in WordPress is really easy, and the search operation and replacement is no different. If you know another way Evolva SQL and do not want to install a plugin to do the job, then the second way is right for you. However, if you want to advance your service and would prefer a plugin do the work for you, then the option is one his way.