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 tmp6d400b_posts SET guid = replace(guid, 'http://domainA.com', 'http://domainB.com');

UPDATE tmp6d400b_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');

 

 

 

 

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Reply

Scroll to Top