Login to WordPress When You Can’t Get to wp-admin or wp-login.php

Recently, I had a customer contact me about not being able to get to the login screen on her site. She was using our Simple Maintenance Mode Pro plugin. Apparently, her theme was set up to redirect wp-admin and wp-login.php to a custom page. The custom page was block by the maintenance mode plugin and any attempt to access the login screen would display the maintenance mode page.

At first, I thought there was no other solution than to get into the backend and modify the maintenance mode plugin to by-pass calls to the custom page. Then I figured out a workaround.

Note- This approach will only work if the redirect to the custom page happens after wp-login.php tries to process the login.


Step 1 – Get a copy of the login form from wp-login.php

<form name="loginform" id="loginform" action="http://www.yourwebsite.com/wp-login.php" method="post">
<p>
<label for="user_login">Username<br />
<input type="text" name="log" id="user_login" class="input" value="" size="20" /></label>
</p>
<p>
<label for="user_pass">Password<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
</p>
<p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember Me</label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In" />
<input type="hidden" name="redirect_to" value="http://www.yourwebsite.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>


Step 2 – Replace domain with your domain

There are two places in the form you need to update with your domain.

<form name="loginform" id="loginform" action="http://www.yourwebsite.com/wp-login.php" method="post">
<input type="hidden" name="redirect_to" value="http://www.yourwebsite.com/wp-admin/" />

Step 3 – Save, open, and login

Save the file to your hard drive or server. Then open it and log in.

Go Ahead...ShareShare on Google+Buffer this pageShare on FacebookTweet about this on TwitterPin on PinterestShare on StumbleUponShare on LinkedInShare on TumblrEmail this to someone
Posted in Tutorial
How To Get 4,692 Subscribers
The step-by-step guide to more conversions
  • The one thing you must do to get subscribers
  • How to find the traffic that converts more than any other traffic
  • What to include in your auto responsder to keep 'em subscribed
  • The exact method I use to skyrocket my email list to more than 4692 subscribers

Download Now