Moving WordPress to a new host comes down to backing up your files and database, then copying both across. With the domain unchanged, that's most of the job. If your new server uses different database details, update wp-config.php to match, and sort out your permalinks when the site goes live.
Moving with your domain unchanged
- Back up your WordPress directory, images, plugins and other files.
- Back up the database.
- Copy the files to the new host.
- Copy the database to the new host.
- Edit wp-config.php if the new server's database details differ.
- When the site goes live, reconfigure permalinks if you use them.
To point your domain at the new host when you're ready, check your host's help page.
Work out which move you're making before you touch anything, because the two routes aren't interchangeable. Keep the same domain and that list covers the WordPress side. Change the domain as well and you'll want the longer route further down this page.
Don't skip the first two steps because you're in a hurry. If anything goes wrong, that backup is your way back, and there's a separate guide on backing up a WordPress site if you've never done one.
The files and tables you'll touch
| What you're changing | Where it lives | When you need it |
|---|---|---|
| Database name, user and password | wp-config.php | When those details differ on the new server |
| siteurl and home | The wp_options table in your database | When you want to test before switching |
| Site Address and WordPress Address | Settings > General | When the domain is changing |
| Permalinks | .htaccess, then your permalink settings | When the site goes live |
Two of those labels sound alike. The Site Address (URL) is the address people type to reach your blog. The WordPress Address (URL) is where the core files reside.
Testing the new host before you switch
You can look at the moved site before sending visitors to it. To do that, temporarily change siteurl and home in the wp_options table of the database. Just remember that's only for the test, so undo the change afterwards if your real address isn't changing.
If you use permalinks, disable .htaccess during this stage and reconfigure permalinks when the site goes live.
The longer route when your domain changes too
A new host and a new domain at once is a bigger job, and the order matters.
- Download your site files.
- Export your database from MySQL.
- Move both copies somewhere safe.
- Go to Settings > General and change the URLs.
- Save, and expect to see a 404 page.
- Download the files again.
- Export the database again.
- Edit wp-config.php with the new server's database name, user and password.
- Upload the files.
- Import the database on the new server.
Don't skip the second download. The first set is your safety copy from before the URLs changed, and the second set is the one you move.
If you're still deciding where to go, you can read our review of one WordPress host, but get the backup done first either way.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
The search and replace trap on a changed domain
Here's the part you wouldn't guess. It looks as though you could open the database and swap the old URL for the new one everywhere. Run a plain search and replace across the whole database and you can break serialised data, which is how themes and widgets store their settings.
WordPress documents safer routes for this: a plugin such as Better Search Replace, or the search-replace command in WP-CLI. Either way, take your backup before you run anything, so you've got something clean to return to.
If the moved site misbehaves
- If the site can't reach its database, compare the login details in wp-config.php against the new server.
- If links misbehave once the site is live, reconfigure your permalinks if you haven't yet.
- If you've finished testing, check the temporary siteurl and home values have been set back.
- If theme or widget settings have vanished after a domain change, suspect a plain search and replace and restore from your backup.
Frequently asked questions
Will I need to touch code if my domain isn't changing?
Not necessarily. Only if the new server's database details differ.
Do I need a plugin to move WordPress?
Not when your domain and URLs stay the same, as copying your files and database is enough.
How do I get the database onto the new server?
Export it from MySQL on the old server and import it on the new one. For the exact screens, check your host's help page.
Will visitors see the move happening?
You can look at the moved site first by temporarily changing siteurl and home. For how and when visitors move across, check your host's help page.
Is WP-CLI a safe option for swapping URLs?
Yes, its search-replace command is one of the serialisation-safe options.
Why am I seeing a 404 after changing the URLs?
That's expected when you save new URLs before finishing a domain change. Keep going with the files and database.


