πŸ”— How to update SiteURL and HomeURL

July 6, 2020 (4y ago)

Here is how you can update the SiteURL and Home URL in WordPress database using terminal and MySQL queries:

Log in to MySQL

πŸ–₯️

mysql -u [username] -p

Select the database to update.

πŸ–₯️

USE [database_name];

Run update query.

πŸ–₯️

UPDATE wp_options SET option_value = replace(option_value, '[http://oldurl]', '[http://newurl]') WHERE option_name = 'home' OR option_name = 'siteurl';

And it’s done!