divider

Error After Changing URLs in WordPress General Settings

Services: Law Firm Website Design . SEO . Internet Marketing . Law Firm Marketing Guide . Content Marketing . PPC

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.

wordpress-general-settings

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.

define('WP_HOME','http://www.yourdomain.com');
define('WP_SITEURL','http://www.yourdomain.com');

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.

wordpress-general-settings2

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.

update_option('siteurl','http://www.yourdomain.com');
update_option('home','http://www.yourdomain.com');

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.


Related Posts