A frustrated WordPress developer

Can’t access WordPress after changing the site url?

So you changed the site URL and your website is down. Don’t Panic!

If you can’t access wordpress after changing the site url, there’s a few reasons this could happen.

  • The most obvious is a typo
  • Your DNS settings may not be setup for WWW, HTTPS, etc..

There’s three different solutions to fix this issue if you can’t access your WordPress site after changing the site url. I will list them by my personal preference of simplicity.

1. Change the site URL through PHPMyAdmin

If you don’t have access to PHPMyAdmin or don’t feel comfortable editing the database skip to step 2.

*Note: Always take a back up before making changes in the database.

Below is a quick gif showing how I changed the URL and added the WWW to my url structure.

gif of changing the site url through phpmyadmin

Here’s some written steps

  1. Login to your PHPMyAdmin Dashboard
  2. Locate your database
  3. Expand your database and select wp_options (your database may have a different prefix than WP)
  4. Find the two tables: ‘siteurl’ and ‘home’. You will update both of these. Click edit on one.
  5. Change the url and click go. Do this for both and you are done.

2. Edit your wp-config

This is a temporary solution to get you back up and running.

  1. Edit your wp-config.php file (located in your root folder)
  2. Define your WP_HOME and WP_SITEURL settings by inserting these two lines somewhere towards the top:

    sample image of the wp-config.php file with the newly defined url

3. Change the site URL through your functions file.

The last way is you can change the site url is through your functions.php file.

Simply add this code to the top of your file:

Any of these three will get you back up and running if your site is down.

Is there a 4th way? Let me know!