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
<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.
Step 3 – Save, open, and login
Save the file to your hard drive or server. Then open it and log in.