How to move wordpress site to new domain

Moving a WordPress site to a new domain can be a bit of a process, but it's definitely doable. Here's a step-by-step guide to help you through the process:

Before you start:

  1. Backup your site: Make sure to backup your WordPress site, including the database and files, before making any changes. This will ensure that you can restore your site if anything goes wrong during the transfer process.
  2. Update your DNS: Update your DNS (Domain Name System) settings to point to the new domain. This may take some time to propagate, so be patient.

Step 1: Update your WordPress configuration

  1. Update the wp-config.php file: Open the wp-config.php file in a text editor and update the DB_HOST, DB_USER, and DB_PASSWORD variables to reflect the new database settings.

  2. Update the wp_options table: Run the following SQL query to update the wp_options table with the new domain:

    UPDATE wp_options SET option_value = REPLACE(option_value, 'old-domain.com', 'new-domain.com') WHERE option_name = 'site_url' OR option_name = 'home_url';

    Step 2: Update your site's URLs

  3. Update the wp_options table: Run the following SQL query to update the wp_options table with the new domain:

    UPDATE wp_options SET option_value = REPLACE(option_value, 'old-domain.com', 'new-domain.com') WHERE option_name = 'site_url' OR option_name = 'home_url';
  4. Update the wp_posts table: Run the following SQL query to update the wp_posts table with the new domain:

    UPDATE wp_posts SET post_content = REPLACE(post_content, 'old-domain.com', 'new-domain.com');

    Step 3: Update your theme and plugins

  5. Update your theme: If your theme uses hardcoded URLs, you may need to update them manually.

  6. Update your plugins: Check your plugins for hardcoded URLs and update them as needed.

Step 4: Update your DNS

  1. Update your DNS settings: Update your DNS settings to point to the new domain. This may take some time to propagate.

Step 5: Test your site

  1. Test your site: Test your site to ensure that everything is working as expected.

Additional tips:

  1. Use a plugin: Consider using a plugin like Duplicator or UpdraftPlus to help you move your site to a new domain.
  2. Use a staging site: Set up a staging site and test the transfer process before moving your live site.
  3. Be patient: The transfer process may take some time, so be patient and don't rush through it.

By following these steps, you should be able to successfully move your WordPress site to a new domain. Good luck!