12

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

  • 2
    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

15 Answers 15

9

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.

  • 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
4

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)

  • 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 at 23:00
1

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.

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)

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.

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!

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

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.

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.

  • 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.

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.

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.

-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.

-1

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

-2

my error was due to directive below in nginx confing file

location ~ \.php$ {

               #fastcgi_hide_header "Set-Cookie"; # Cache page with cookie 

protected by Community Jul 30 '18 at 16:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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