Sometimes, you may want to hardcode the website path URL in WordPress. A good example is if you cannot get to the admin section. Changing the site URL is particularly useful for those who need to update their website’s domain name or move their site to a different server.
To do this, you will need to have access to the files.
Add the following to the wp-config.php file:
For detailed information refer to the WordPress documentation, Changing The Site URL.