Change the Domain of a WordPress Site Using This MySQL Command

Use the following MySQL commands to change the URL of your WordPress website. You will need to modify the old and new domains in the code as well as the database prefix (wp_).

Change Your WordPress Site Domain

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, '', '');

UPDATE wp_postmeta SET meta_value = replace(meta_value, '', '');

Next Steps