Recently I was having a problem trying to access one of my WordPress installations. The first thing I noticed was that my login screen had lost all of it’s css styles and the input fields were all the way to the left of the screen.
Usually when things like this happen, it comes to mind that maybe you just upgraded a plugin which caused the problem, or your WordPress installation became corrupted somehow, perhaps your database is having problems, and the list goes on and on.
It can be really easy to become desperate and try to do too many things at once, which might make things worse, or in the best case scenario fix things, but at the end you don’t know what fixed the problem. So here are some tips on how to gain access to your WordPress dashboard. Try them one at a time and hopefully you will regain access again to your WordPress dashboard.
Check your WordPress htaccess file
In my case I am putting this one first because it was the problem I was having. The .htaccess file is a hidden file that controls directory-level configuration and is supported by several web servers. What that means is that it locks down and protects certain areas of the server from unauthorized access, improves performance, and most importantly if configured the wrong way can cause all kinds of trouble.
With that said if you have an .htaccess file that you plan to edit, make sure that you make a copy or copies of it in case something is wrong and you need to go back. I suggest renaming it like .htaccessBak_Date.
This file in my case had a wrong directive that was somehow changed most likely by me, but I didn’t noticed until the next time I was trying to do some administrative tasks and couldn’t log in.
*Important* there are a few places where you might find an .htaccess file, like the root of your website and in my case I have one inside the wp-admin to only allow access to myself from a specific ip address. You can read more about how to harden and secure WordPress at Wpshout.com
Also you can check some more resources to learn tips and tricks at perishablepress.com
Check your file sizes
Let’s say that you recently were updating your WordPress installation, plugins or themes, the process of doing that can corrupt files for various reasons. The file that you want to check is the index.php inside the wp-admin directory. That file is one of the files which allow you to access the administration area, if during the upgrade that file somehow became compromised and was overwritten or became corrupted then you have problems.
To troubleshoot this one, you can try and check and compare the file size if you have access to another WordPress installation that is working fine, of course you need ftp access to check the file size to check for differences. You might also want to download both the good file and the “suspect” file if they are both the same size, and use a good text editor like Notepad++ and use the compare plugin included to check for file differences.
Clear your cache
Many times if your browser is not giving you fresh content because your settings are to not refresh pages very often, then that can cause the page to display an old copy. To force your browser to flush the cache make sure your F-Key on your keyboard is active, then press the crtl key + F5, another method is to press shift + crtl + del your browser will open another window asking you if you want to delete all the contents of your cache. Click ok and try reloading the page. *Tip – when I am doing this method I usually close the problem page or navigate away from it, go to any different site and then apply either one of the cache clearing techniques.
Check your browser ad block settings or addons
I use ad blocks in my browser via addons which you might need to disable or whitelist your page. The one I use for Firefox is Adblock + which displays an icon on the browser as a red icon that reads ABP inside what looks like a stop sign. If you right click on it, you can select to disable on the page you are on at the moment. The change can be made permanent or only for that session. If you know that you are going to be logging in to your site all the time, it might be worth making it permanent. Reload your page and see if that clears the problem.
Check the WordPress Forums
The great thing about the WordPress forums is that you have a huge collective knowledge of people that are willing to guide and help with your problem. If you don’t have an account with them, make one and post your question in the right section. This goes without saying but be polite, have patience, read the responses, then read them again. Sometimes in desperate times, we miss a small detail that means fixing or breaking things further. And say thank you.
I hope that one of these tips will help you find the solution to your problems accessing the WordPress dashboard.