Change wordpress site URL on backend(Mysql, Mariadb)
Date Posted: 17-03-2017
This post assumes that wordpress already installed. If server is fresh and it doesn’t have webserver or database server, follow the below post to install wordpress.
Install Nginx, PhpFpm and MariaDB
The webserver, database server can be anything other than nginx and mariadb.
Implementation:
Let’s assume the current wordpress URL is domainA.com and you would like to change to domainB.com.
Login to mysql backend and execute the below commands to change the Site URL.
UPDATE wp_options SET option_value = replace(option_value, 'http://domainA.com', 'http://domainB.com') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'http://domainA.com', 'http://domainB.com'); UPDATE wp_posts SET post_content = replace(post_content, 'http://domainA.com', 'http://domainB.com'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://domainA.com', 'http://domainB.com');