I never thought I would see this.
But it happened.
last week, when I tried to access my WordPress dashboard through WP-admin slug, it showed me a 404 page.
So what that meant?
Quite clearly, it means my WordPress installation was not able to find and retrieve the data from WP-admin directory.
If the same has happened to you, don’t worry. We can solve and get rid of this problem very easily. It takes only a minute or two. Also, In this tutorial, I will try to simplify the complicated processes as much as I can so if you are a beginner, there’s no need to get nervous.
Remember to take a complete backup of your database before starting out with any of the given procedures.
Let’s get started!
Finding The Cause Of The WP-admin Redirection & Refresh Error
It may happen that every time you hit the login button even with the correct credentials, the page gets refresh and you are returned to the same page and fate as well. The first step you need to take is finding the cause of this problem.
There are several known reasons which might occur and force wp-admin to redirect either to the homepage, wp-login page (refresh error) or a 404 page in worst case scenario.
1. Plugin Conflict
Some plugins and majority of them which are related to secure WordPress are the root cause of this error.
To check if the main cause of your wp-admin redirect problem is a plugin or not, You have to look through your FTP client.
Since you can’t log in to your WordPress dashboard, you will need to access your plugins directory through an FTP client. FTP or the file transfer protocol helps you to connect your device to your server at the administrator level.
You can use Filezilla or CoreFTP as they both are helpful for beginners as well as high on features.
Here’s how to log in with FTP:-
- Get your FTP access credentials (ask your host)
- Download and install Filezilla on your PC
- Login to your server
Then head on to the WP-content folder which can be located in the public.html folder.
Here in the plugins directory, start deleting the plugins one by one. After deleting every one plugin, go back and try to login to your WordPress dashboard. If you are able to log in after deleting any plugin, that means the cause was a plugin conflict.
This will usually happen
If the problem still persists, you should check out the other reasons below.
2. Theme Conflict
Themes, the same way a new or an old plugin can be a cause for Wp-admin redirect problems, can be responsible for this error.
For inspecting if the wp-admin redirection problem is occurring by any theme update, change or functions.php file changes, you will have to repeat the same process as you did in the case of plugins.
In this process, you will have to delete the theme by deleting its existence in your themes folder that is located near your plugins directory in the same wp-content folder.
Try deleting the themes, and at the same time try to log in to your WordPress dashboard. This should solve your problem.
If the wp-admin redirection/page refresh problem still persists, do check out the other steps below.
3. Reach Out To Your Web Hosting Support
If neither theme nor the plugins were the cause, it probably means that the problem is with your allocated server i.e. your host.
Before you reach to your hosting support team, let’s make sure the problem is with the servers. For doing this, you will need to launch your PHP my admin area.
PHP my Admin software is used to access the MySQL and MariaDB database. WordPress database is written and runs on MySQL and MariaDB.
To confirm your host is causing this problem, try launching PHP my Admin and access your MySQL database. If you succeed, congrats, your servers, and host both are fine and working.
If you are unable to access your MySQL database and PHP my admin shows failed login error, you need to ask your host. Contact their support team and they will provide you with all the necessary details on this issue.
4. .htaccess File Corruption
It may happen that you added code in your .htaccess file. It may also happen that you never knew about it and did nothing.
.htaccess is a sensitive file that helps WordPress to handle requests between a server and a web browser and it should be handled carefully. Sometimes, it gets corrupted due to reasons like plugin conflicts.
All we have to do to get rid of this wp-admin redirect error is delete this corrupt .htaccess file.
Simply log in to your FTP client, take a backup of the existing .htaccess file and then delete this corrupt .htaccess file. That’s it.
Go back and check if you can no login to your WordPress dashboard or not. Once you are in your WordPress admin area, go to the settings section and get to the permalinks settings. Do not change anything and click on save. This will generate a new, fresh .htaccess file.
If this didn’t solve your problem, then follow the steps below.
5. Site URL Error
In some cases, when none of the above-mentioned solutions worked this did.
Sometimes, simply updating the site URL solves the problem. All you need to do is:
- Login to your FTP client area
- Locate the WP-Config file
- Take a backup of it
Then edit it and add this line of code:-
Replace the “yourdomain.com” with your original domain.
That’s it. Go back to your wp-admin page and try to log in again.
6. Cookies And Cache
If you are still not able to login to your WordPress dashboard, You may need to clear your cache and cookie files.
Cookies enable and help the WordPress authentication and memory process. When you hit the remember me checkbox, it’s cookies that do the function of saving your password and username in the browser.
All you need to do is clear all your browser cache and cookie files but make sure to keep them enabled. Then close your browser and restart it.
By now, you should have gained your access back to the WordPress admin dashboard.
In some cases, you may have to wait a couple of hours before you gain your access to your admin area. I hope this guide has helped you.
Do leave a comment below and mention which method worked for you.