How to Moving a WordPress site from one URL to another Print

  • 4

 

Moving a WordPress site from one URL to another involves a few steps. Here's a simplified guide to help you through the process:

  1. Backup your site: Before making any changes, make sure to back up your entire WordPress site, including files and the database.

  2. Move the WordPress files: a. If you are moving the site to a different domain on the same server, use your hosting control panel's file manager or an FTP client to move the files. b. If you are moving the site to a different hosting provider, first download the files from your old hosting account using an FTP client, and then upload them to the new hosting account.

  3. Export the WordPress database: Log in to your old hosting account's control panel and access phpMyAdmin. Select your WordPress database and click on the "Export" tab. Choose "Quick" as the export method and "SQL" as the format, then click "Go" to download the database export file.

  4. Create a new database on the new server: Log in to the new hosting account's control panel and create a new MySQL database. Also, create a new MySQL user and grant the user all privileges on the newly created database.

  5. Import the database: Access phpMyAdmin on the new hosting account, select the newly created database, and click on the "Import" tab. Choose the database export file you downloaded in step 3, and click "Go" to import the database.

  6. Update the wp-config.php file: Using your hosting control panel's file manager or an FTP client, open the wp-config.php file in your WordPress root directory. Update the database name, username, and password to the new ones created in step 4.

  7. Update the site URL: a. In the new hosting account's phpMyAdmin, select the imported WordPress database. b. Click on the "SQL" tab and enter the following queries, replacing "http://oldurl.com" with your old URL and "http://newurl.com" with your new URL:

    UPDATE wp_options SET option_value = replace(option_value, 'http://oldurl.com', 'http://newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'http://oldurl.com','http://newurl.com'); UPDATE wp_posts SET post_content = replace(post_content, 'http://oldurl.com', 'http://newurl.com'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://oldurl.com','http://newurl.com'); 

    c. Click "Go" to execute the queries and update the URLs.

    All you would need to do is change the OLD-DOMAIN section to the NEW-DOMAIN and then paste that into the SQL section inside phpmyadmin. Changing URLs on Wordpress is unlike other scripts in which you would have a configuration file that you would need to edit.  In Wordpress, everything configuration related is located inside the database.
  8. Update permalinks: Log in to your WordPress dashboard using the new URL, go to "Settings" > "Permalinks", and click "Save Changes" to update the permalink structure.

  9. Optional: Set up a 301 redirect: To avoid broken links and preserve SEO, set up a 301 redirect on your old domain, redirecting traffic to the new URL. You can do this using your old hosting account's control panel or by modifying the .htaccess file.

  10. Test your site: Verify that all pages, images, and links are working correctly on the new URL. Additionally, make sure that all plugins and themes are functioning as expected.

Remember to update any third-party services and integrations (such as Google Analytics) with the new URL.

 

 

 


Was this answer helpful?

« Back