WordPress

How to update SiteURL and Home URL

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_dev>;

Run update query.

UPDATE wp_options SET option_value = replace(option_value, '<http://www.oldurl>', '<http://www.newurl>') WHERE option_name = 'home' OR option_name = 'siteurl';

And it’s done!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: