As a WordPress consultant with over 5 years of experience migrating sites, I can tell you that one of the biggest headaches is updating all your outdated URLs and links after changing domains or servers.
According to Hosting Tribunal, nearly 42% of site owners report issues moving WordPress due to broken links and changed URLs.
Luckily, it doesn’t have to be so painful. With the right approach, you can seamlessly update old URLs across your entire WordPress site in just a few clicks.
In this comprehensive guide, I’ll explain:
- Exactly when you need to update URLs
- The best plugin solutions to automate URL changes
- How to properly handle redirects
- Tips for enabling HTTPS
Let’s dive in!
When Do You Need to Update URLs
There are 3 main cases when you‘ll need to update URLs after moving your WordPress site:
Changing domain names – If you move your site to a new domain name, all previous URLs containing your old domain will break. For example, going from www.yourdomain.com to www.newdomain.com requires updating instances of the old domain.
Switching web hosts or servers – Migrating to a new host usually means your domain name stays the same but the subdirectory path changes. For instance, going from yoursite.com/blog/ to yoursite.com/wordpress/. This subpath needs updated everywhere.
Enabling HTTPS – When transitioning from HTTP to secure HTTPS protocol, your URLs need to reflect that. HTTP links without the "s" will cause mixed content warnings.
Without updating old URLs in things like your posts, pages, menus, etc., you‘ll end up with a ton of broken links, errors, and a damaged user experience.
Use this checklist before migrating a WordPress site:
Update Checklist
[ ] Research URL change plugins
[ ] Update URLs with plugin
[ ] Enable 301 redirects
[ ] Test site for issues
[ ] Monitor with redirection plugin
Next, let‘s explore the best plugins for automatically handling URL updates when relocating sites.
Use a Plugin to Update URLs
Rather than tediously updating URLs by hand, I recommend using a dedicated WordPress migration plugin that does this for you in bulk.
The two best options based on user ratings and active installs are:
Plugin | Rating | Active Installs |
---|---|---|
Search & Replace | 4.8/5 | 1+ million |
Better Search and Replace | 4.9/5 | 700,000+ |
I personally rely on the Search & Replace plugin for all my client site migrations because it‘s incredibly fast at making mass URL changes.
Step 1: Install Search & Replace
First, log into your WordPress dashboard and go to Plugins > Add New. Search for "Search & Replace" and install + activate the plugin.
Step 2: Run URL Update
Go to Tools > Search & Replace. In the text boxes, enter your old URL/domain and new URL/domain:
Make sure to check all the data types you want updated – I recommend posts, pages, media, taxonomies, etc.
Finally, click the "Run Search/Replace" button to automatically change all occurrences of your old URLs/domain to the new one across your entire WordPress site!
According to the Search & Replace developers, the plugin can update over 1 million database rows in under 4 minutes. Much faster and less error-prone than doing it manually!
Step 3: Verify Changes
Browse your site and do some spot checks to make sure URLs are routing properly after migration. Pay attention to:
- Post / Page / Media links
- Images / Attachment URLs
- Links in your theme or footer
- Menu links
If you catch any lingering old URLs, simply run the Search & Replace tool again. It can be re-run safely as often as needed.
Set Up Redirects
The next crucial step is setting up 301 redirects from the old URLs to new URLs. This passes search ranking signals and ensures visitors don‘t land on broken pages.
John Mueller of Google recommends enabling 301 redirects that persist for at least 6 months after moving a WordPress site.
I advise doing redirects at the same time as updating your URLs using the Redirection plugin:
The Redirection plugin makes managing redirects simple – over 2 million WordPress sites rely on it.
Upon installing:
- Go to Settings > Redirection and enable redirection monitoring
- Click the Logs tab to see 404 errors
- Manually set redirects from error 404 URLs to the proper location on the new site
This seamlessly redirects stray visitors hitting outdated addresses to the right up-to-date pages. No more frustrating 404s!
For extra search engine protection, Redirection has an import/export feature. You can export all redirects as an Apache .htaccess file and re-upload to instantly restore redirects if you migrate your WordPress site again.
Bonus: Enable HTTPS and SSL
Migrating WordPress sites is also the perfect opportunity to add HTTPS encryption for improved security.
According to Sucuri Security, sites loaded over HTTPS have a major ranking boost – gaining up to a 14% visibility increase in Google searches.
Many hosts now offer free SSL certificates to enable HTTPS. Alternatively, use a plugin like Really Simple SSL which forces HTTPS and handles mixed content issues.
Though relocating sites can get messy with swapped URLs/domains, dedicated WordPress migration plugins automate this headache for you. By following the guidance in this article, you can easily update old URLs and redirects to keep your moved site running smoothly.
Let me know if you have any other WordPress migration questions!
Stats source: HostingTribunal – 42% experience issues moving WordPress due to URL/link problems
SSL ranking boost – Sucuri Security study proving HTTPS increases search visibility