Threat Picture
Latest Cybersecurity News
How to Change Your WordPress URL in MySQL

How to Change Your WordPress URL in MySQL

Two rows in wp_options decide where your site lives. The SQL to change them when the admin screen isn't an option.
By Charles Joseph · Updated
Share
Share
Copy URL

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:

  • 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’

Sponsored

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?

Related Posts:

QUOTE:

"Amateurs hack systems, professionals hack people."