How to move a WordPress Site to a New Domain

There are many reasons to move a website to a new domain. One of them is moving a site from a subdomain to a real domain, or moving a site from a free hosting subdomain to a paid host and domain. Some marketers say that with a 301 redirect you can get rid of a Google sandbox.

One of my websites was recently penalized and I wanted to try out the latter theory. I moved the penalized site to a new domain and I used the 301 permanent redirect. This is how I did it:

  1. Go to the cPANEL of your hosting account > click on file manager > click on the folder of the site and compress the file. This will create a .zip file of your site’s files. If done corretly it should look like this This won’t delete the folder of your website.
  2. Go to the FTP manager and download the compressed file. In FTPZilla you can simply drag it on your desktop.
  3. Go to Cpanel > phpMyAdmin > Select the database of the site > Download/EXPORT it (make sure you select UFT8 as Character set of the file). Put it on your desktop.export wordpress
  4. Log in to the admin section of your ‘old’ wordpress site > Tools > Export > Select ‘All Content’ and Download Export File (in case you mess up this file will come in handy). This file will contain all posts and pages of your website, but no images.
  5. Go to the cpanel of the site where the new domain is hosted and create a new database in “MySQL Databases”. Lets call the database database_A. Now add a new user to database_A and lets call it user_A. Remember the password of user_A.
  6. To to phpMyAdmin and import the database you exported in step3. It should be on your desktop. You can only import it if the database is empty.
  7. Unzip the file from step 2 and upload it to your new domain via FTP or FileManager.
  8. Open the file called wp-config.php and enter the database_A and user_A+password to this file. You will enter the database name like this: define(‘DB_NAME’, ‘database_A’)
  9. Your new site should work now.
  10. This is the last step: 301 permanently redirect your old site, this way google and other search engines will know that you have moved your site and will (hopefully) pass pagerank and backlinks. Within 2-3 weeks you should see the new site ranking for the old keywords on the same position.

Top 301 redirect a site open the .htaccess file of the old site and add this line

Redirect 301 /

Please leave a comment if this has helped you.

Resources: free image by Eros Erika @dreamstime

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>