Skip to content

How to move WordPress to a new host

By Ash, Founder, HosteazePublished 3 min read

To move WordPress to a new host, back up your site, copy the files and database to the new server, and update wp-config.php with the new database details. Test the site on the new server using your computer's hosts file, then point your domain's DNS at the new host. Keep the old hosting live until DNS has fully switched.

A white van driving fast along a country road, carrying its load to a new address.
Credit: PublicDomainPictures via Pixabay

Moving a WordPress site sounds risky, but if your domain name is staying the same it's mostly copying. WordPress's own handbook says that when the database and URLs don't change, you can move a site "by just copying your files and database". The real skill is in the order: copy, test, then switch, so visitors never see a broken site.

Which migration method should I use?

MethodBest forSkill neededWatch out for
Migration plugin (for example Duplicator or All-in-One WP Migration)Most small sitesLowLarge sites can hit your host's upload size limit on free versions
Manual: SFTP plus database exportLarge sites, or when plugins failMediumGetting wp-config.php details right
New host migrates it for youAnyone who'd rather notNoneCheck what's included before you sign up

Many hosts include migration. If you're moving to us, migration is free. Whichever you choose, the checks below still apply.

How do I move WordPress manually?

How do I test the new site before switching DNS?

Use your computer's hosts file. It tells your computer alone to visit the new server when you type your domain, while everyone else still sees the old one.

What if my domain name is changing too?

Then the database is full of your old address, and a plain find-and-replace can break things. WordPress warns that some themes and widgets store data with the length of the URL recorded, so changing it by hand corrupts those settings. Use a tool that handles this, such as the Better Search Replace plugin or WP-CLI:

wp search-replace 'https://old-domain.co.uk' 'https://new-domain.co.uk' --skip-columns=guid

Skip the guid column. WordPress uses it to identify posts in feeds and says it should never change.

When can I cancel my old hosting?

Not straight away. DNS changes can take up to 48 hours to reach everyone, as explained in how long DNS propagation takes. Keep the old account for at least a week, and check that new orders, comments and form entries are arriving on the new server before you close it. If your email lives with the old host, move that first.

Step by step

  1. 1.Back up everything

    Take a full backup of your WordPress files and database and save a copy on your own computer.

  2. 2.Lower your DNS TTL

    A day before the move, lower the TTL on your domain's A record to 300 seconds so the switch spreads faster.

  3. 3.Copy the site to the new host

    Use a migration plugin, or upload the files by SFTP and import the database through the new host's control panel.

  4. 4.Update wp-config.php

    Change DB_NAME, DB_USER, DB_PASSWORD and DB_HOST to the new database details.

  5. 5.Test using your hosts file

    Point your domain at the new server's IP address in your computer's hosts file and check the site works.

  6. 6.Switch DNS

    Update your domain's A record or nameservers to the new host, then keep the old hosting for at least a week.

Frequently asked questions

Will moving hosts affect my Google rankings?

Not if your domain and URLs stay the same and the site doesn't go down. Google sees the same pages at the same addresses. Rankings can wobble if the move causes downtime, broken pages or a much slower site, so test before switching DNS.

What happens to my email when I move WordPress?

It depends where your email is hosted. If it's with Google Workspace or Microsoft 365, leave your MX records alone and it carries on working. If your email is with your old web host, plan its move separately before you cancel that account.

Should I move my domain at the same time?

No. Move the website first and keep the domain where it is. Transferring the domain is a separate job you can do later, and doing both at once makes problems harder to trace.

Sources

  1. WordPress Advanced Administration Handbook, Changing the site URL and Moving WordPress
  2. WordPress Advanced Administration Handbook, WordPress Backups
  3. WP-CLI, wp search-replace
A seedling planted in a small mound of soil on a potting bench beside terracotta pots, a new site ready to grow.TutorialHow to install WordPressThe quickest way to install WordPress is your hosting control panel's one-click installer, which takes a few minutes. To install it by hand, create a MySQL or MariaDB database and user, upload the WordPress files from wordpress.org to your web folder, then visit your domain and follow the setup screens. Afterwards, set your permalinks, timezone and HTTPS address.WordPress speed · 3 November 2026Close-up of a silver stopwatch face with the second hand near the top, timing how long a page takes to show its main content.TutorialHow to improve Largest Contentful Paint (LCP)To improve Largest Contentful Paint, first find which element is your LCP, usually the hero image. Then cut the server response time with page caching, make sure the image isn't lazy-loaded and has fetchpriority set to high, shrink the image file, and remove render-blocking scripts. Aim for 2.5 seconds or less for three in four visits.WordPress speed · 1 November 2026A slim external hard drive plugged into a laptop by its cable, the kind of separate copy every website backup needs.TutorialHow to back up a WordPress siteA complete WordPress backup has two parts, your files and your database, and you need both to restore the site. The easiest method is a backup plugin such as UpdraftPlus that saves both on a schedule to cloud storage. Keep at least three recent copies in different places, and test a restore before you need one.WordPress speed · 30 October 2026A white power strip crowded with plugs and a bulky adapter, cables tangled across it.QuestionHow many WordPress plugins is too many?There's no safe or unsafe number of WordPress plugins. What matters is what each plugin does, how well it's built and whether it's still maintained. One heavy or abandoned plugin can cause more trouble than twenty light, well-supported ones. Keep only plugins you actively use, delete the rest, and test speed when you add a new one.WordPress speed · 28 October 2026Two network cable plugs lying apart on a black background, a connection waiting to be made.QuestionHow to fix "Error establishing a database connection" in WordPressThis error means WordPress can't connect to the database that holds your content. The cause is usually wrong details in wp-config.php (database name, username, password or host), a database server that's down or overloaded, or damaged database tables. Check the four wp-config.php values first. WordPress's own guide names them as the usual cause.WordPress speed · 26 October 2026

Hosting made for WordPress

See how our WordPress hosting is set up.

See WordPress hosting