Transfer WordPress website to another domain with MySQL

You block advertising

Please disable ad blocker

Read more

Today we will tell you how to transfer WordPress website to another domain with MySQL. For this we need to go to phpMyAdmin or Arminer and go to the SQL tab.

Transfer WordPress website to another domain with MySQL

Here we will need to execute three requests to the database in order – so we will replace all the old domains in the database with new ones:

[php]
UPDATE wp_options SET option_value = replace(option_value, ‘http://old_domain.com’, ‘http://new_domain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

UPDATE wp_posts SET guid = replace(guid, ‘http://old_domain.com’,’http://new_domain.com’);

UPDATE wp_posts SET post_content = replace(post_content, ‘http://old_domain.com’, ‘http://new_domain.com’);
[/php]

Do not forget to rename http://old_domain.com and http://new_domain.com to your values.

That’s all, now your site will link to the new domain.

You block advertising

Please disable ad blocker

Read more
Comments (0)
Leave a Reply

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