How to Search and Replace Text in WordPress
Use this procedure to search and replace text easily in WordPress.
Problem
You realize that you have been using a word or a phrase incorrectly all the time. There are a lot of occurrences so doing the update one by one would be tedious.
Warning
Take a backup of the database before applying the procedure described in this tutorial. This way you can revert changes easily if something goes wrong. If you need help on how to back up the database or even the whole website, check this course.
Plugin
I recommend the plugin Better Search Replace. It is easy to use and it is well-positioned in the WordPress Plugin Directory.
Step 1: Install and activate the plugin Better Search Replace.
Step 2: Navigate to Tools > Better Search Replace to open the plugin settings.
Step 3: Specify a search text, a replacement, and select all tables. Keep the first two checkboxes unchecked and uncheck the last one. Click Run Search/Replace to begin the operation.
Step 4: Navigate through the website and check that all occurrences were replaced successfully and no errors were introduced.
Case sensitiveness
I recommend performing case-sensitive search and replace operations in all cases. This is the default behavior of the plugin and I agree that it is the best choice. Case-insensitive operations may introduce grammatical errors.
Error recovery
If during your review you detect that something went wrong, try to solve the problem if possible. Otherwise, restore your website from the backup taken at the beginning.
Comments