How to Change the Domain of a WordPress Site

To move a WordPress site from one domain to another, use the following steps:

  1. In this example, we are changing the domain of a WordPress site from to

  2. Make a backup of the existing WordPress site for using Softaculous in cPanel, and wait for the process to complete.

  3. Using an FTP app or the File Manager in cPanel, open the public_html folder and rename the folder to, then rename the folder to

  4. Open the wp-config.php file in the folder and make a note of the name of the database.

  5. Visit phpMyAdmin in your hosting account’s cPanel.

    Your cPanel access details are listed on the hosting account’s Info page in the Client Lounge.

  6. In the left column, select the name of your WordPress site’s database.

  7. Select the SQL tab at the top.

  8. Run the following SQL statements (replace all instances of with your old domain, and with your new domain):

    UPDATE wp_commentmeta SET meta_value = REPLACE(meta_value, "", "");
    UPDATE wp_comments SET comment_author_url = REPLACE(comment_author_url, "", "");
    UPDATE wp_comments SET comment_content = REPLACE(comment_content, "", "");
    UPDATE wp_links SET link_description = REPLACE(link_description, "", "");
    UPDATE wp_links SET link_url = REPLACE(link_url, "", "");
    UPDATE wp_options SET option_value = REPLACE(option_value, "", "");
    UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, "", "");
    UPDATE wp_posts SET guid = REPLACE(guid, "", "");
    UPDATE wp_posts SET pinged = REPLACE(pinged, "", "");
    UPDATE wp_posts SET post_content = REPLACE(post_content, "", "");
    UPDATE wp_posts SET post_title = REPLACE(post_title, "", "");
    UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, "", "");
    UPDATE wp_term_taxonomy SET description = REPLACE(description, "", "");
    UPDATE wp_usermeta SET meta_value = REPLACE(meta_value, "", "");
    UPDATE wp_users SET user_url = REPLACE(user_url, "", "");
  9. Edit the site listing in Softaculous and change the old domain to the new one.

  10. Visit your new domain in a web browser to confirm that your WordPress site is working correctly.

Your WordPress site should now be accessible via its new domain!

Should you have any questions or run into any issues, please feel free to open a Client Care ticket via the Client Lounge.

You may also like:

Love our guides? HostM offers professional and helpful WordPress Hosting services with unlimited features and renewal rates that actually match our advertised rates.