WordPress stores its own address in two settings: WordPress Address (siteurl) and Site Address (home). Get them wrong and you can be redirected away from your own site.
Method 1: in settings
If you can log in: Settings → General, change both addresses, save.
Method 2: wp-config.php (when locked out)
- Open System Info & Files then File Manager and edit
wp-config.phpin the WordPress folder. - Above the line
/* That's all, stop editing! */, add:
define('WP_HOME', 'https://yourdomain.co.uk');
define('WP_SITEURL', 'https://yourdomain.co.uk');
- Save and reload the site.
These override the database values. Once you can log in, you can fix the settings and remove the lines, or leave them in place.
Method 3: phpMyAdmin
- Open phpMyAdmin and your WordPress database.
- Open
wp_options. - Edit the
siteurlandhomerows.
After changing domain or moving to HTTPS
Posts, image links and some plugin settings still contain the old address. Use a search-and-replace tool designed for WordPress, which correctly updates serialised data, to replace the old URL with the new one. A plain SQL REPLACE can corrupt serialised settings.
Take a backup first. How to back up WordPress
Choosing somewhere to host WordPress? Traxio’s WordPress hosting includes one-click installs, LiteSpeed caching and free SSL, with your first 30 days free.