Find and replace with a WordPress plugin
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.
- Sign in to WordPress.
- Install and activate the Better search replace plugin.
- 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.
Note: 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 checkbox 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 checkbox.
- Select Run Search/Replace to replace the text in the database.
The old text is now replaced on your site.
More info
- If you’re not able to sign in to your WordPress dashboard you can replace text in the database using the text editor or with SSH.
- Check out the plugins' page on wordpress.org for more information about the Better Search Replace plugin.
- If you don't want to make changes in the database yourself, our WordPress Premium Support team can do that for you.