Changing your WordPress URL and Site URL

This article covers changing your WordPress URL.

For many people out there, the "WordPress Address (URL)" and "Site Address (URL)" fields found in the "General Settings" of WordPress can be hard to understand or change once you have updated them. In many cases, an individual will change this without making the proper changes on their database. Next thing you know your site is down and you cant even login to make changes to your site. Well thats why we are here.

Editing the "WordPress Address (URL)" and "Site Address (URL)" in "General Settings"

To make a change to the URL, you are going to want to login and go the "General Settings" tab underneath "Settings", from there you are going to want to edit the fields called "WordPress Address (URL)" and "Site Address (URL)" to the proper URL. Just click on "Save Changes" and you should be good. A picture of the General Settings page is depicted below.



What to do if you Break Something and Can't Log In (Setting the URLs Manually)

Many times an individual will make the changes or type in something wrong by accident and break their WordPress install. To fix this we will add code to "wp-config.php" to make changes to the URLs manually. So what you are going to want to do is open your "wp-config.php" file in your WordPress install via FTP or SFTP client and add the following code to someplace where it wont be commented out:

define('WP_HOME','http://example.com');

define('WP_SITEURL','http://example.com');

After the code has been inserted, go ahead and update the file to your server and your site should be fixed. This will also disallow editing the URLs within WordPress, so that can be a plus as well.

Hope you enjoyed the tutorial!