Transfer a WordPress site from one domain to another.

While moving a wordpress site from one domain to another, you might find out that the site just breaks down – the layout is broken, the pictures disappear or it is simply not loading at all. This instruction will help you if you need to:

  • transfer from one domain to another or from a subdomain to the primary domain;
  • migrate from the ../ subdirectory to the main directory ../;
  • move website from one domain to another;

Move wordpress site from one domain to another

The transfer might consist of few steps, including SQL queries to change the settings in Phpmyadmin, files migration to a different folder and even a config file edit if you have a VPS. Lets review all three.

Update wordpress SQL tables in Phpmyadmin

All actions should be done in phpmyadmin. Phpmyadmin location depends on webserver setup, often it is available at or similar address, and requires authorization with login and password.

You need to correct the site address in the database in few tables. Select the required database and go to the SQL tab to enter those three lines:

UPDATE wp_options SET option_value = REPLACE(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE(guid, '','');
UPDATE wp_posts SET post_content = REPLACE(post_content, '', '');

Where is the former domain of the site, and is the new domain of the site. If you are using an SSL certificate for the site, replace http with https.

Important: if you have a Cyrillic domain, the domain name in SQL queries must be entered in Punycode format. To convert the Cyrillic domain to Punycode format, use any online converter.

For example, you need to transfer the site to the Cyrillic domain:


The name of this domain in the Punycode format looks like this:

In this case, you need to enter a SQL query with Punycode domain.

An error has occurred. If you see a similar error:

1146 - Table 'wp_options' does not exist

Check whether such a table exists wp_options.

The table prefix may differ from wp, for example: the table is called yourprefix_options, where yourprefix is any set of letters and numbers. If the prefix is ​​different, change the name of the tables in all three queries above.

Move files to a different folder

Hosting providers often bind every domain to a folder with a corresponding name. If this is your case, make sure to move files to a folder with a name. Copy-Paste methods may differ depending on the hosting control panel / your ability to use FTP/SFTP file managers.

Modify webserver Nginx / Apache configs

If you use a VPS / custom webserver you might avoid moving files from one folder to another if you simply set up a site config to look at the current folder for the new domain:


server {
listen 80;
root /var/www/;
#Other config settings..


<VirtualHost *:80>

DocumentRoot /var/www/

<Directory "/var/www/">
allow from all
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f


Clear all caches

Clear the wp-content/cache/ folder if you have caching configured. Also make sure to check the site with incognito mode and look through other caching methods you have enabled.

Follow Sam Tyurenkov:
Hi there, I'm a web-designer, marketing and product manager, business developer. I have created this website and about 25 others. I'm also doing various tasks for IT projects besides websites - like mobile games.