Fix broken links after moving my WordPress site to a new domain
If you find broken images and hyperlinks throughout your WordPress site after changing a domain, follow these steps to remove outdated link paths.
- Sign in to WordPress.
- From the Plugins menu, select Add New.
- Type Better search replace.
- Find the Better Search Replace plugin and select Install Now.
- When the plugin has installed, select Activate.
- From the Tools menu, select Better Search Replace.
- Enter your site's old URL in the Search for field. For example, http://olddomainexample.com (no trailing slash).
- Enter your site's new URL in the Replace with field. For example, http://newdomainexample.com (no trailing slash).
- Select all database tables from the Select tables field.
- Leave Run as dry run checkbox ticked and select Run Search/Replace. That way, you will be able to check the results beforehand.
- Select Click here to see in which database tables URLs will be replaced, and a window with the results will pop up.
- Uncheck the Run as dry run checkbox.
- Select Run Search/Replace to replace the URLs in the database.
Note: If you don’t want to check the results before you initiate the actual change in the database, continue from step 12. However, we advise following the next two steps to make sure that unwanted changes won't occur.
If you also moved a website to a different server, please check if a custom upload path option is available under Settings > Media. If you don't see this option, no further actions are required. On the other hand, if this field is available, remove the entry to reset the media upload path to a default one for a new server and select Save Changes.
- Troubleshoot a media upload error in WordPress
- Troubleshoot and fix 404 error, broken links, or redirect issues
- If you don't want to fix broken links yourself, our WordPress Premium Support team can do that for you.