Most people are opting for WordPress when building both personal and business websites. The platform offers many excellent features that allow easier creation of content. In the admin area website owners can create posts, pages, install themes for fun styling of the site and use plugins for additional functionality.
Even though starting with WordPress is fun, one of the things that can crop up on occasions that will make you sweat is realising that you can no longer access the wp-admin URL of your site. In this post, we will look at why the WordPress admin not working issue arises and how to fix it.
Why you might get locked out of the WordPress Admin panel
You can be locked out of the WordPress Admin panel of your website for several reasons. Here are some of the main causes and what you can do to fix them.
Error establishing database connection
If this error has been appearing on your whole website, it means that your WordPress website could not establish a secure database connection. That can arise due to various reasons.
One of the main causes is a corrupted database. It can also happen if the website hosting server has problems or if the login credentials or wrong or have hanged. If this has prevented you from accessing your admin area, you should try to establish a secure database connection.
White screen of death on wp-admin
If your screen is displaying a white or blank screen each time you try to access the WordPress Admin panel, it is a problem known as the “white screen of death”. The problem arises after you have exhausted the offered memory limit for your site. It can be a result of poorly coded plugins or themes using the memory or unreliable website hosting services. We have a few solutions here to fix the white screen of death.
Incorrect password issues with wp admin login
You will not be able to access your WordPress Admin area if you type the wrong username and password combination. At times, that might happen by mistake, or it might be a result of a hack attempt on your site.
If that happens, the best thing to do is to reset the password. If you can not do it via the forgot password option on the login screen then you will need to reset it from the phpMyAdmin. The method can be overwhelming for some beginners but follow on below, and you will be able to fix the WordPress admin not working.
Lost admin privileges
At other times, you might be trying to login to the wp-admin panel, but instead, you do not see any admin functionality. A quick example, you may not find any themes or plugins and only see some basic user information.
The issue mostly arises after the modification of user permissions. Mostly, it happens after a hack. Hackers are known to infect websites before deleting the admin privileges. In such cases, you will have to use MySQL to add an admin user to your WordPress database.
PHP errors often occur when the website owner is pasting codes from a website. Mostly, beginners use inbuilt WordPress editors from their dashboard. The feature is handy, but for people who do not know what they are doing, it can turn out to be a real problem.
After you have pasted the code from another website you, unfortunately, realise that you are locked out of the admin area. The first thing you should do after that happens is to take a deep breath and use an FTP program to fix the issue.
Start by installing the program and login to your website. Move to your theme file, which you modified – most likely the functions.php file. Get rid of any code that you added and re-upload the file. You should now be able to reaccess the admin area. Read below about fixing php errors and the white screen of death.
The quickest solutions
What to do if there is an error establishing a database connection
The first thing you need to do is check that your database credentials are correct. Have you recently changed your cPanel password or database password? You need to update the credentials in the wp-config.php file.
Go to your website files using Filezilla or via your hosting file manager and find the wp-congif.php file. In that file look for the details in the screenshot below and make sure they are correct, if not correct them.
Save the file and then try to reaccess your site. If this did not work, you could try some of our other solutions to fix the error establishing a database connection in WordPress.
What to do if the password reset fails
If logging in to the WordPress admin dashboard is impossible, the first thing that you would want to do is reset the password. If you have not done that, click on the “Lost your password?” link in the admin login page for the reset.
The link will land you in another page offering an area for you to enter your email or the username and you will receive an email featuring the new password. But if you have tried that and it has failed, then you will have to do a manual reset. To do that, you need to edit the database using PhpMyAdmin or edit the functions.php file.
In some scenarios, the best thing to do if you want to get to the WordPress admin dashboard is to edit the database manually and change the password. The process is easier if you can access the PhpMyAdmin in your website host.
Before you do anything, it is always good you back up the site. Learn more about our WordPress Maintenace Services which provide daily backups and much more including fixes like these.
After you have backed up the data, you need to login to the host admin panel such as the cPanel, ask for your log in link and details from the web host. While in the cPanel, scroll down to your database section and then click on the PhpMyAdmin. Click on the Databases to see all the databases in your account and then click on your “users” table.
Mostly, the web host will name it “wp_users” unless you specified another prefix during your WordPress installation. In such cases, you will find it named “yourprefix_users”. Click on the edit button situated near the admin user.
Now, enter the new password in your “users_pass” input box and choose md5 located in the function dropdown list. Click on Go. At this point, you should be able to login to your WordPress Admin area using the new login details.
The second method of resetting the password manually involves editing your functions.php file in the active theme so that it can include the “wp_set_password” function. To use the file, you will require the FTP access.
Problems associated with cookies
Cookies are tiny files that the websites you visit store on your computer’s browser. Cookies are beneficial as they provide many functions for websites, including remembering your preferences when you visit individual sites.
To prevent them from doing that, you need to disable cookies in your browser settings. But because your WordPress login requires cookies to function well, after disabling them, you will face many problems, particularly when logging in to the admin dashboard.
Most login problems arise due to issues associated with cache and cookies. And because the problem is easier to fix, you should start with this option to know whether it is the cause of your login issue.
If the cookies on your browser are disabled, enable them. After that, clear the browser cookies and cache by pressing ctrl-shift-delete in your Windows computer or command-shift-delete on your Mac computer. In the page that pops up, ensure that the selected items are caches and cookies solely and then click on the clear button.
What to do if the blank page appears or you get PHP error messages
Most website users report this problem when they try to login to their WP admin area and find the WordPress admin not working; the issue is usually traced to theme or plugin coding errors. The best solution is to disable the plugins or disable the active theme.
To do that, you will have to access your website through FTP. To know whether plugins are the primary cause of the login problem, you will have to deactivate (rename) the plugins folder to prevent WordPress from reading it.
Before we do that it is also worth noting that this issue can arise from lack of memory, so first check with your host that you have not exhausted your memory. You can also try to increase it your self by adding the following line to your wp-config.php file, but it does not work on all hosts.
To deactivate/rename your theme or plugin folders, access your WP files through FTP. You can use a program called Filezilla which once logged in will display the folders and files of your website. Search for the folder that contains your WordPress blog.
Double click on it. If your site is on the main domain, the folder will most likely bear the name “public_html”. And if the folder exists in a subdomain, you will find a file named after that subdomain.
Search for the “wp-content” folder and then double click on it to open. After that, search for your plugins folder and right click on it. Choose Rename – change it to a name that WordPress will not read something like “pluginsold”. After that, log in to the WP dashboard. If the login is successful, one of the plugins is the culprit.
If the plugins are not the problem source, you will have to deactivate your theme. The deactivation process involves renaming your theme folder so that WordPress cannot read it anymore.
To do that, use Filezilla or another FTP client to access your WP files. After that, locate the wp-content folder and right click on it to open. In the folder, find the themes folder and right click on it to open. Rename the active theme folder so that WordPress can revert to your default theme. Try to login again. If the login is successful, contact the theme provider for the solution.
What to do if the URL shows a 404 not found error or it redirects or the page refreshes
At times, you will receive a “404 not found” error or get redirected to other websites. You might also land on the correct page, but it refreshes each time you try to log in. You can fix the error by creating a .htaccess file or updating the website URL. To know whether the .htaccess is the source of the problem, deactivate it by rename and try to log in.
To rename it, access your site through FTP and double click on the public_html folder. Locate the .htcaccess file, right-click it, and click on Rename. Change the name to .htacess.old.
Try to login again. If the problem resolves, create another .htaccess file from the WordPress dashboard by clicking on Settings>Permalinks and then click on save changes. This will automatically trigger WordPress to create a new .htaccess file. If the step fails, you will have to change the website URL manually. To do that easily, edit the wp_config file.
I hope that the above solutions help you access your WordPress admin panel. If they fail, you can get in touch with our WordPress help and support service, and we can fix it for you. Alternitavely you may want to concider our WordPress Care Plans where we take care of all the technical aspects of your site for you.