Moving WordPress to a new domain without losing anything

Changing name is more than swapping an address. If the site already has visitors, links pointing at it and a presence on Google, what you want is that anyone arriving at the old address ends up on the new one, page by page, with nothing breaking on the way. Order matters: almost everything that goes wrong is a step taken too early.

The right order

1 Take a full backup: files and database. If this step fails, do not do the rest. See making and keeping your own backup.
2 Point the new domain at your plan and make sure it opens something. See changing the domain on your plan and, if the domain is registered elsewhere, pointing your domain to us.
3 Wait for the certificate. The new domain needs its padlock before the site moves over. The server issues it by itself (AutoSSL) once the domain points here, and only then is it worth changing the rest.
4 Change both WordPress addresses in Settings, General. Switching to a domain that does not answer yet locks you out. The order and the emergency exit are in changing the site address.
5 Replace the old addresses inside your content with a proper search and replace tool. Images and links written out in full keep pointing at the old domain. If your account has the option, WP Toolkit or Softaculous may do the swap for you.
6 Save the permalinks again, in Settings, Permalinks, and clear the caches.
7 Redirect the old domain to the new one, address by address. This is the step that protects visitors and what Google already knows about your site. It comes next.

Redirecting the old domain

In the old domain’s .htaccess, above the WordPress block, add a rule that sends every address to the same address on the new domain:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?theold\.co.mz$ [NC]
RewriteRule ^(.*)$ https://thenew.co.mz/$1 [R=301,L]

The 301 tells browsers and Google the move is permanent. Swap theold and thenew for your own names. The theory and the common mistakes are in 301 redirects.

What else to change

Where What to do
E-mail on the old domain Keep it running. The mailboxes live on the old domain until you move them on purpose.
Search Console Add the new domain, confirm it is yours and use Google’s change-of-address tool. It is a Google product, used by you.
Google Analytics Update the data stream’s address, so the statistics stay in one place.
Sitemap Submit the new domain’s sitemap. See robots.txt and sitemap.xml.
Social profiles Change the site link on each one, and in your e-mail signatures.
Do not let the old domain expire. The redirect only works while the old domain stays registered and points somewhere that answers. If it lapses, every old link dies, and anyone can register it and receive your visitors. See domain renewal.
Rehearse before changing the DNS. You can see the site on the new domain before it points here, on your own computer, with the hosts file.

Moving domain and want a second opinion before you start? Describe the site, the old domain and the new one.

Open a support ticket

SEE ALSO

Hosting migration

WordPress hosting

SSL certificates

Support Policy

RECOMMENDED PRODUCT

WordPress hosting

One-click install, updates handled, and speed that holds up. from $5.36/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?