Domain change via sql queries in phpmyadmin

**!!! It is recommended to create a backup copy of the database before proceeding

Go into phpmyadmin → on the left side click on your database → SQL tab and make 3 sql queries

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 old domain and is the new domain

Changing the domain via normal phpmyadmin and text editor

Do export of WP database via phpmyadmin to local computer


Open DB in Notepadqq or Notepad2 text editor, shortcut Ctrl+H to bring up search window and replace all links from old address with new one


Import the database back via phpmyadmin into the newly created database and plug that database into wp-config.php

Check it works.

Updated Oct. 22, 2020