How to Change Your WordPress Site URL

Update the WordPress site address safely from the dashboard, wp-config.php, or the database when locked out.

· Updated · 2,335 views

The site URL tells WordPress where it lives. Changing it incorrectly can lock you out, so use the method that matches your access level and update both addresses consistently.

Change It from the Dashboard

If you can log in, this is the safest route.

  1. Go to Settings > General.
  2. Update WordPress Address (URL) and Site Address (URL).
  3. Save changes. You will be logged out and must log in at the new address.

In most setups both fields should match.

Change It in wp-config.php

If the dashboard is unreachable, define the URLs in wp-config.php:

define( 'WP_HOME', 'https://yourdomain.co.ke' );
define( 'WP_SITEURL', 'https://yourdomain.co.ke' );

These values override the database and grey out the Settings fields while present.

Change It in the Database

As a last resort, edit the values in phpMyAdmin:

  1. Open the wp_options table.
  2. Edit the rows where option_name is siteurl and home.
  3. Set both option_value fields to the new URL.

| Method | Use when | |---|---| | Dashboard | You can log in | | wp-config.php | You have file access only | | Database | Both above are unavailable |

After changing the URL, save Settings > Permalinks to rebuild rewrite rules, and clear any caching plugin so visitors are not sent to the old address.

Was this article helpful?

Your feedback helps us improve our documentation.

Still Need Help?

Our support team is available 24/7 to assist you.