WordPress uses a database to store your site’s data. The easiest way to find and replace that data is with a plugin. It’s useful when you’re replacing a piece of text (like a domain name) that shows up across your site.
Warning: Always make a backup of your site before making any changes to the database.
- Sign in to WordPress.
- Install and activate the Better search replace plugins.
- On the left-side menu, select tools > Better Search Replace.
- In the Search for field, enter the text you want to replace.
- If you’re changing a domain, enter your site’s old URL here. For example, http://olddomainexample.com (no trailing slash).
- In the Replace with field, enter the new text.
- If you’re changing a domain, enter the new URL here. For example, http://newdomainexample.com (no trailing slash).
- In the Select tables field, select all the database tables in the list.
Grade: If you don’t want to check the results before you initiate the actual change in the database, continue from step 9. However, we recommend following the next two steps to make sure that unwanted changes won’t occur.
- Leave the Run as dry run check box selected and then select Run Search/Replace. That way, you can check the results beforehand.
- Select Click here to see in which database tables the text will be replaced, and a window with the results will pop up.
- Clear the Run as dry run check box.
- Select Run Search/Replace to replace the text in the database.