Update wordpress siteurl

By | 12th July 2023

Use this command to update site url from mysql prompt. Make sure you have the necessary permissions and access. More details can be found in the link below.

UPDATE wp_options SET option_value = replace(option_value, 'oldurl.com', 'newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';UPDATE wp_posts SET guid = replace(guid, 'oldurl.com','newurl.com');UPDATE wp_posts SET post_content = replace(post_content, 'oldurl.com', 'newurl.com'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'oldurl.com','newurl.com');

Link: https://www.hostinger.in/tutorials/wordpress/how-to-change-wordpress-urls-in-mysql-database-using-phpmyadmin