How to Change a WordPress Website Domain Name
This tutorial shows how to manually change a WordPress domain in as little as five minutes or less.
Apr 27, 2026

Steps to changing your domain name in WordPress:
- Visit phpMyAdmin and select the database. (Note that if you don’t know what your database is, you can get it from your wp-config file in DB_NAME.)
- Then click on the SQL tab.
- Next, paste the code below:
UPDATE wp_options SET option_value = 'https://newdomain.com' WHERE option_name IN ('siteurl', 'home'); UPDATE wp_posts SET post_content = REPLACE(post_content, 'olddomain.com', 'newdomain.com'); UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'olddomain.com', 'newdomain.com'); - Make sure that the table prefix matches what is on your WordPress installation. You can also find your table prefix in your wp-config file. Simply open the wp-config file and search for $table_prefix. The default is often wp_ but some installations change this to something else.
- After confirming, click on Go in your bottom right.
- The code contains three queries so you’d see three green lines showing your query ran successfully.
- Visit your new domain and all should be working properly.
If you have any issues, kindly chat me up on LinkedIn.
