WordPress Help

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.

Warning: Always make a backup of your site before troubleshooting or making any changes.
  1. Sign in to WordPress.
  2. From the Plugins menu, select Add New.
  3. Type Better search replace.
  4. Find the Better Search Replace plugin and select Install Now.
  5. When the plugin has installed, select Activate.
  6. From the Tools menu, select Better Search Replace.
  7. Enter your site's old URL in the Search for field. For example, http://olddomainexample.com (no trailing slash).
  8. Enter your site's new URL in the Replace with field. For example, http://newdomainexample.com (no trailing slash).
  9. In the Select tables field, select all the database tables in the list.
  10. 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.

  11. Leave the Run as dry run checkbox selected and then select Run Search/Replace. That way, you can check the results beforehand.
  12. Select Click here to see in which database tables URLs will be replaced, and a window with the results will pop up.
  13. Clear the Run as dry run checkbox.
  14. Select Run Search/Replace to replace the URLs in the database.

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.

More info