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 Link
In this article
Close
The WordPress table that houses your site’s URL is wp_options, where wp_ is your database table prefix.
WordPress All-in-One For Dummies: Run Your Site With Confidence
- Set up, customize and maintain a WordPress site without hiring help.
- Find the answer fast when something breaks.
- Learn the settings that keep your site running smoothly.
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 3-2-1 Rule for Backups You Can Count On
ExplainingComputers lays out the 3-2-1 rule as a reminder to keep proper backups.
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?
Read Next
MySQL Essentials: A Guide to Key Commands
Log in without exposing your password, view and create databases, and more. The MySQL commands worth having at your fingertips.
Read More 
How to Reset a WordPress User’s Password From Within MySQL
Locked out of the admin screen? The wp_users table and one SQL command put you back in.
Read More 
How to Import and Export MySQL Databases
mysqldump out, mysql in. The command-line steps for backing up and restoring databases and single tables.
Read More 
QUOTE:
"Amateurs hack systems, professionals hack people."
