Fix broken links after moving WordPress site

Glenn Glenn's Blog 0 Comments

Before you consider moving your WordPress site we do thoroughly recommend BackupBuddy to substantially ease and automate the transfer process. If you’ve already transferred your site then don’t worry as help is still at hand.

So what’s happened?

References to your old site are still present in your WordPress setup and they are referencing back to your old site. This can include internal (admin) and external links and also your media library file references.

What do I need to do?

You need to update those erroneous references and we recommend the following steps:-

1. Open up your site wp-config.php file and look for:-


define('DOMAIN_CURRENT_SITE', 'your-site-name.com');

Make sure that ‘your-site-name.com’ matches your domain or localhost and if not then change it

2. Update all the references in your WordPress database to the old site

You can run SQL Queries but as we have WordPress we might as well use a plugin to do everything for you. You can use the BackupBuddy server tool find and replace, but we also recommend the following free plugin to do the job – ‘Better Search Replace‘.

  1. Backup your site database (again you can use BackupBuddy or an alternative backup plugin)
  2. Activate ‘Search and Replace’ and then go to Tools / Search & Replace
  3. In ‘Global Search & Replace’ Search for “your-old-site-name.com” and Replace with “your-new-site-name.com”
  4. Click ‘Go”

And that’s it all references to the old site are updated with the new address.

About the Author
fix broken links after moving wordpress site Fix broken links after moving WordPress site 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g

Glenn

A highly experienced WordPress Web Developer, Front-end and Back-end Developer & New Media Specialist with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries built up over a number of years.

Leave a Reply

Your email address will not be published. Required fields are marked *