Changing your WordPress site’s URL isn’t always done from the admin dashboard. Sometimes, especially after a domain change, site migration, or an SSL issue, you may need to manually update the URL directly from phpMyAdmin.
If you’re locked out of your WordPress dashboard or your site is redirecting incorrectly, this step-by-step guide will help you safely change the URL from phpMyAdmin, using only the cPanel provided by your hosting account.
Why You Might Need to Change the WordPress Site URL
Here are common scenarios where you might need to change your WordPress site URL:
-
You moved your site to a new domain (e.g., from
myoldsite.com
tomynewsite.com
) -
You transferred your site to a different folder (e.g., from root to
/blog
) -
The website shows a “Too Many Redirects” error
-
You switched from
http
tohttps
and now have loading or mixed content issues -
You’re restoring a backup on a different domain or server
Changing the site URL and home URL values in your WordPress database helps resolve these.
What You’ll Need
-
Access to your hosting account’s cPanel
-
phpMyAdmin access (usually available under the Databases section)
-
Your new domain or desired URL
Important: Always make a backup before editing the database.
Step-by-Step: How to Change WordPress URL via phpMyAdmin
Step 1: Log in to cPanel
-
Go to
https://yourdomain.com/cpanel
-
Enter your hosting login credentials
Step 2: Open phpMyAdmin
-
In the Databases section, click phpMyAdmin
-
phpMyAdmin will open in a new tab
Step 3: Locate the WordPress Database
-
On the left-hand side, click your WordPress database
-
If you’re unsure of the database name:
-
Go to File Manager →
public_html/wp-config.php
-
Look for this line:
define('DB_NAME', 'your_database_name');
-
-
Step 4: Find the wp_options
Table
-
Inside your database, click the table called
wp_options
-
If you changed the default table prefix, it might be named like
abc_options
-
-
You will now see rows with the following values:
-
siteurl
-
home
-
Step 5: Change siteurl
and home
Values
-
Find the row with
option_name = siteurl
-
Click Edit
-
In the
option_value
field, replace the current URL with the new one (e.g.,https://yournewdomain.com
) -
Click Go to save
-
-
Repeat the same for
option_name = home
These two values control the primary URL of your WordPress installation.
Step 6: Clear Your Browser Cache and Cookies
-
After making changes, clear your browser cache or open your site in an incognito window to test
-
You may also clear the cache using plugins (once your admin area is accessible)
Optional: Update URLs in Content and Media (if needed)
Changing the siteurl
and home
values will not automatically update links inside your posts, images, or menus. If you’ve moved domains, you may also need to replace old URLs inside the content.
You can use a plugin like Better Search Replace or Velvet Blues Update URLs after you regain admin access.
In Case You Lose Access After Changing the URL
If you accidentally enter the wrong URL:
-
Revert it by repeating the above steps
-
Or, edit
wp-config.php
and force the URL using:
This will override the database settings temporarily.
Best Practices
-
Always take a backup of your database before editing it
-
Use
https
if you have an SSL certificate installed -
Make sure both
siteurl
andhome
match unless your site is configured to run from a subdirectory
Common Mistakes to Avoid
Mistake | Consequence |
---|---|
Leaving a trailing slash (e.g., https://yoursite.com/ ) |
Usually okay, but can cause issues in some plugins |
Forgetting to update both siteurl and home |
Site may load inconsistently or admin area may break |
Typo in domain (e.g., htps:// ) |
Locks you out — must be corrected from phpMyAdmin again |
Editing the wrong database | No change will happen, or wrong site may break |
Conclusion
Changing your WordPress URL from phpMyAdmin is a reliable way to recover your site or finalize a domain migration especially when the WordPress dashboard is inaccessible. As long as you follow each step carefully and back up beforehand, this method is perfectly safe and effective.