WordPress is great for its easy-to-use interface, allowing even those of us without the ability to code to launch a website. While simple to use, you may have discovered there are a number of ways to break your site. You have a number of tools at your fingertips and sometimes updating the wrong field can bring down your site!
Here’s one example, that will leave you blocked from WordPress, without a front-end method to log back into the WordPress dashboard (don’t worry, I’ll also tell you how to fix it).
One of the easiest ways to break a WordPress website is by going into the Settings and changing the WordPress Address (URL) and/or the Site Address (URL).
It was so nice of WordPress to give you the ability to update the WordPress Address. What they don’t tell is that if you update this URL, you’ll break your site and eliminate the ability to access the page again to fix!
If you incorrectly make an update here, you’ll find yourself blocked out of the WordPress admin. Your entire site will likely break, and the login at example.com/wp-admin.php will no longer function.
If you are in this situation, luckily there is a way to fix! It doesn’t even require a site backup or programming knowledge. However, you will need hosting or CPanel access. It will also require a bit of digging to find the right file to update.
The process is a bit different for every hosting provider. If you are using GoDaddy, open up the manage hosting experience and click on file manager.
From here, open up the public_html folder. All the public facing website assets live here. If WordPress is installed at the root directory of the domain, you should see a file with the name wp-config.php in the folder.
A few changes to this file and your site will be back in action. If you don’t see the file listed, you can search for the file name using the search bar. Since you’ll be making a change to a core file, the first thing you’ll want to do is download a copy of the file.
It’s always good to have a backup of the file before you start making changes should things go south.
Once you’ve downloaded a copy, select the file and click edit. GoDaddy allows for the inline code editor to easily make changes to files. Again, this may differ depending on the hosting provider you’re using.
Once the file is open, the first line will be <?php. Create a new line and paste the following two lines of code, with example.com replaced with the correct location of your WordPress site.
Save the file and recheck the site. After the file is saved, the fix should be in place instantly. Go back to the WordPress login page to see if it did the trick.
Still not working? Make sure you followed the steps correctly and that you have the WordPress address correct. For instance, if you’re using WordPress only for a blog at example.com/blog then that might be the directory WordPress is installed.
Hope that gets you back in gear. These sort of things happen, and they happen often. If you aren’t making mistakes, then you aren’t pushing yourself far enough.