This post may contain affiliate links, please read our affiliate disclosure to learn more.
How to Change Your WordPress URL in MySQL

How to Change Your WordPress URL in MySQL

Author
 By Charles Joseph | Cybersecurity Researcher
Clock
 Published on December 26th, 2023
Table of Contents show

The WordPress table that houses your site’s URL is wp_options, where wp_ is your database table prefix.

The wp_options table schema has 4 columns:

NordVPN 67% off + 3-month VPN coupon

Stay One Step Ahead of Cyber Threats

Want to Be the Smartest Guy in the Room? Get the Latest Cybersecurity News and Insights.
We respect your privacy and you can unsubscribe anytime.
  • option_id
  • option_name
  • option_value
  • autoload

Two rows in this table maintain your site’s URL. These are locatable from the values specified in “option_name,” — siteurl, and home.

The SQL command to change these values in MySQL:

Site URL

mysql> UPDATE wp_options SET option_value = ‘https://your-domain.com’ WHERE option_name = ‘siteurl’

Home

mysql> UPDATE wp_options SET option_value = ‘https://your-domain.com’ WHERE option_name = ‘home’

SOURCE: How do I change the WordPress Site URL?

QUOTE:
"Amateurs hack systems, professionals hack people."
-- Bruce Schneier, a renown computer security professional
Scroll to Top