Move WordPress to a New Domain – Easy Site Migration – Yoast

Move WordPress to a New Domain - Easy Site Migration - Yoast

Jono Alderson

Jono is a digital strategist, marketing technologist, and full stack developer. He’s into technical SEO, emerging technologies, and brand strategy.

Sometimes, branding, technical or business decisions mean that you need to change your domain. If you’re not careful, a poorly managed move can really hurt your SEO. Thankfully, WordPress makes things pretty easy – here’s everything you need to do.

10 steps to move WordPress

This guide assumes that you’re moving from one domain to another. If your migration is more complex (e.g., a subdomain on one site, to a folder on another), you may need to adapt the instructions.

  1. Take a backup of everything

    There’s a lot that can go wrong if you’re not careful when you start moving files and databases around. If you run into problems, it’s best to make sure that you can hit a ‘reset’ button and restore a backup.

  2. Add a robots.txt file to the new site

    Upload a robots.txt on the new domain (or edit it through your Yoast SEO plugin settings), with the following contents:

    User-agent: *
    Disallow: /

  3. Copy everything across

    Get a copy of your files and a copy of your database, then move everything across to your new hosting environment. You may need to configure your storage and database settings!

  4. Configure your wp-config.php file

    Make sure that you have the right database settings for the new hosting environment, and add the following lines (replacing with the new domain).

    define('WP_SITEURL', '');
    define('WP_HOME', '');

  5. Access and configure your site

    Now everything should be accessible on the new website; but you should definitely double-check, and make sure that all of your settings are correct.

    If you have a caching plugin or system, don’t forget to empty out all of the old data.

  6. Find and replace old domain values

    Install the Search and Replace plugin, and do a search and replace for



This article was written by Jono Alderson and originally published on Yoast • SEO for everyone.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

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

Show Your ❤️ Love! Like Us
Scroll to Top