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.
- Go to Settings > General.
- Update WordPress Address (URL) and Site Address (URL).
- 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:
- Open the
wp_optionstable. - Edit the rows where
option_nameissiteurlandhome. - Set both
option_valuefields 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.