15

I am having some difficulty logging into my WordPress site. When I attempt to visit example.com/wp-admin, I see a blank page and the url bar changes to:

http://example.com/wp-login.php?redirect_to=http%3A%2F%2Fmysite.com%2Fwp-admin%2F&reauth=1

If I visit example.com/wp-login.php, I only see a blank white page without any change to the URL.

I have confirmed this is not a problem with anything on my local machine as the behavior persists across multiple browsers and devices.

I have found numerous forum posts about the issue but none offer a satisfactory solution.

Please help as I urgently need to update content on the site.

Update: I turned WordPress debugging on and see the following error

Fatal error: Cannot redeclare check_password_reset_key() 
(previously declared in /home/wordpress/public_html/wp-login.php:281) 
in /home/wordpress/public_html/wp-includes/user.php on line 1637

Any tips on how to fix this would be greatly appreciated

  • 3
    Clear your cookies. – Wyck Jan 27 '14 at 0:41
  • When was the last time you were able to log into WP? wp-admin redirecting to wp-login.php is correct. Did you change something, e.g. add a plugin? – user42826 Jan 27 '14 at 1:15
  • I was able to login last time I tried a couple of days ago. I did install a plugin but I deleted it and the problem persists – user44754 Jan 27 '14 at 1:22
  • Check your htaccess to make sure it's not wonky. – MikeNGarrett Jan 27 '14 at 2:25
  • If all else fails, enable debugging in wp-config.php define('WP_DEBUG', true); and access wp-admin. You should be able to see the error messages and why it is blank. My guess is a plugin error if it was working previously. – user42826 Jan 27 '14 at 17:59

17 Answers 17

10

Had the same problem... clearing the cookies didn't do the trick.

What did the trick was logging in via incognito mode first, and then I was able to login normally.

| improve this answer | |
  • 1
    Not sure why this is downvoted... after removing the session_token, I used incognito too. I will need to clear chrome cache too, but incognito helped solved the issue by highlighting part of the problem was the browser. Chrome has ruthless cache and is often at the center of issues like this. – Tisch May 7 '16 at 15:04
  • Upvoted, it worked for me. Weird. – IAmJulianAcosta Jun 2 '16 at 23:20
5

There are many possible causes to this problem. Some have to do with your database. Try turning on WP_DEBUG and interpreting the error messages.

In my own case (which is how I stumbled on your question here), the problems was writing a session token into usermeta. I went into PhpMyAdmin > wp_usermeta > and deleted the meta_value for session_token. (Detailed story here https://wordpress.org/support/topic/possible-fix-for-sudden-redirect-loop-at-wp-login-with-reauth1)

| improve this answer | |
  • This along with clearing your browser cache should be the accepted answer. – Tisch May 7 '16 at 15:05
  • I used query like this `UPDATE wp_usermeta SET meta_value='' WHERE meta_key='session_tokens' AND user_id=<myuserid>; – newman Jan 19 '17 at 22:00
  • In my case, session_tokens wasn't even set for my user. Or more specifically, the user_id had somehow been changed to a random number. I have no idea how it happened. So make sure there is actually a line in wp_usermeta with your user_id and meta_key=session_tokens – David Mar 27 '19 at 23:00
  • Big thanks! I had messed with my primary site URL in a wordpress multisite setup. I was only able to login in incognito mode - deleting all cookies for my domain and cleaning the cache didn't help. I removed the value for the session_tokens of the wp_usermeta table and it fixed my issue :) Well done sir! – Andrew Dec 30 '19 at 21:16
2

This could be caused by a wordpress table crashing. Setting define('WP_DEBUG', true); in the wp-config.php will show you exactly what table has crashed if this is the case.

| improve this answer | |
1

I resolved this problem by defining security keys in wp-config.php:

define('AUTH_KEY',         '');
define('SECURE_AUTH_KEY',  '');
define('LOGGED_IN_KEY',    '');
define('NONCE_KEY',        '');
define('AUTH_SALT',        '');
define('SECURE_AUTH_SALT', '');
define('LOGGED_IN_SALT',   '');
define('NONCE_SALT',       '');

For some reason they were empty... Replace empty strings by some generated here: https://api.wordpress.org/secret-key/1.1/salt/ (thanks Josh Rodgers)

| improve this answer | |
1

Any time you have a forward from http://mysite to http://mysite/, this is bound to happen. In my case, I have a managerial httpd process running that has several virtual hosts. One was configured thusly:

<VirtualHost *:*>
    ServerName mysite.com
    ProxyPass "/blog" "http://bloghtml/blog/"
    ProxyPreserveHost On
</VirtualHost>

Changing "/blog" to "/blog/" fixes the problem.

| improve this answer | |
1

this happened to my when I upgraded my website to php v7.4. downgrading to php 7.3 solved it. Unfortunately, I don't know how to keep the version and fix the issue. Hopefully soon WP developers will fix this issue.

| improve this answer | |
0

I also had this issue but had a different message. After working through the myriad of fixes: htaccess, renamed plugins, renamed theme, checked for blank space in wp-config.php I was still stuck.

Logging into PHPMyAdmin I tried to optimize tables but got a user denied error. It turned out to be the database itself being oversize and then 'blocked' by the shared hosting. After finding the main culprit (a Wordfence log table) I truncated that, waited 30 minutes and hey presto, it all worked again.

Thought this might help someone else completely stuck after trying every other suggested option!

| improve this answer | |
0

Just went through this same thing. No luck with clearing cache, .htaccess, DB session clearing, ftp disabling plugins etc. I was able to log in w/ Chrome incognito. Afterwards I was still not able to log in normally. Browser cache alone did not work, I had to specifically delete all cookies related to the domain.

Settings > Show Advanced Settings > Content Settings >

Under Privacy Settings, click on the “Content Settings” button

Under Cookies, click on the “All Cookies and Site Data” button

Then Search for your website by a keyword in the search box: Highlight your website and click Delete on your keyboard.

Click Done and try to login to your site again (in Normal mode .. ie. just exit out of Incognito mode by closing the window)

If you already had the site open in another tab, you'll get a cookie error. close all tabs, re-open, login and enjoy

| improve this answer | |
0

None of the above worked for me.

After enabling debug mode:

define('WP_DEBUG', true);

in wp-config.php

The site was telling me permission issues with the database user...

What did work for me, was reverting back to the root database user (rather than a 'web' user with less permissions).

Obviously not a long-term solution but gives you something else to try that may work for you.

| improve this answer | |
0

I would like to contribute to the community and also since this problem was very annoying. Non of the solution worked for me. I did not install any plugins before it happened so definitely I think it is a Wordpress bug!

My exact errors: Via WP debugger. After login screen came white screen with this error.

 Fatal error: Class 'PasswordHash' not found in /var/www/public_html/example.net/wp-includes/pluggable.php on line 2079

Via apache error log.

PHP Fatal error:  Class 'PasswordHash' not found in /var/www/public_html/example.net/wp-includes/pluggable.php on line 2138, referer: http://example.net/wp-login.php?redirect_to=http%3A%2F%2Fexample.net%2Fwp-admin%2F&reauth=1

How I did solve the problem. 1. In DB I edited my admin password to plain text password. 2. Added these lines of code to pluggable.php. Basically now WP recognizes non hashed passwords. Here is the edited extracts of pluggable.php

function wp_check_password($password, $hash, $user_id = '') {
<------>global $wp_hasher;

<------>//20170713 Added by Stefan
<------>$check=($hash==$password);
<------>return apply_filters('check_password', $check, $password, $hash, $user_id);

... and a bit lower

function wp_set_password( $password, $user_id ) {
<------>global $wpdb;

<------>//$hash = wp_hash_password( $password );
<------>//20170713 Changed by Stefan
<------>$hash=$password;

Hope this helps someone, because googling did not help me.

| improve this answer | |
  • Since than everything runs smooth until today I had to create new blog in my multi install and since the script needs to add a user and his password, some more of commenting was necessary to completely eliminate password hashing. Just to let you know. – user2047710 Aug 24 '17 at 18:12
0

I had the same problem but could not get ride off after spending too much time got this answer from here http://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-login-page-refreshing-and-redirecting-issue/ so its just a cookie problem we need to clear browser cookie and enable it again and that`s it.

| improve this answer | |
0

I fix this by using https:// to access my website instead of http:// that way I did not get any redirection. https://my_website.com/admin You can also change the "siteurl" and "home" values in the options table via phpmyadmin in the cpanel to point to a https. I am of observant that this could be an issue with ssl not redirecting properly.

| improve this answer | |
0

I expericed this issue after migrating my site from one server to another. After importing the database to the new server, I wasn't able to login. On the new server I hadn't SSL-secure the site yet, so I had to change the siteurl and home in the database.

Fix

  • I fixed it by going to database and changing siteurl and home from https:// to http:// within wp_options.

This might help others.

| improve this answer | |
0

Try removing the querystring in the URL ("?" and everything behind it) - that is: visit wp-login.php directly. It worked for me. I tried changing password, changing salts, clearing meta_value for session_tokens in wp_usermeta. None of that worked.

Sorry, I know this does not help you, as you say your wp-login.php screen is white, but it might help someone who like me got drawn here by the headline.

| improve this answer | |
-1

It happened to me after I changed site URL but I forgot to change site_url in wp_sitemeta. Then I changed the value to the new URL, and problem solved.

| improve this answer | |
-1

I fixed my problem by replacing the wp-login.php file with one of another website where the login was working.

| improve this answer | |
-2

my error was due to directive below in nginx confing file

location ~ \.php$ {

               #fastcgi_hide_header "Set-Cookie"; # Cache page with cookie 
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.