Recently, a client decided to purchase an alternative domain name for their existing website. They decided to log into their WordPress dashboard and start poking around. They changed the WordPress Address and Site Address under General Settings to the new domain name. Needless to say, this wasn’t a good idea. After the changes were saved, the website was no longer functioning.
The site wasn’t displaying and I couldn’t access the WordPress login to get to the dashboard. In order to correct the issue, I needed FTP access so I could modify the wp-config.php and functions.php file.
The following code can be used to manually define a website URL through the wp-config.php file.
Within seconds the website was working.
However, I was faced with another issue. When I logged in to WordPress and went back to the General Settings, the text fields were disabled.
In order to edit these fields, I added the following code to the top of the functions.php file, immediately after the initial “<?php” line.
After I uploaded the new version of the functions.php file, I removed the code that was added to the wp-config.php file.
When I logged back into WordPress, the text fields under General Settings were editable.
The last step was to remove the code that I added to the functions.php file and the issue was solved.
Check out my previous post, which will show you how to use your .htaccess file to redirect an alternative domain.