Skip to:
Content
Pages
Categories
Search
Top
Bottom

Stop redirecting to the WP login page?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Profile photo of ozgirl57
    ozgirl57
    Participant

    @ozgirl57

    I just had the same problem and fixed it this way. I don’t know if this is the right way to do it, but it seems to work for me.

    Find your login form. Mine is located in my sidebar.php file. The first line of the form should look like this

    <form name=”login-form” id=”sidebar-login-form” class=”standard-form” action=”<?php echo site_url( ‘wp-login.php’, ‘login’ ) ?>”

    Where it says

    action=<?php echo site_url( ‘wp-login.php’, ‘login’ ) ?>”

    I just deleted wp-login.php, so now the line looks like this

    <form name=”login-form” id=”sidebar-login-form” class=”standard-form” action=”<?php echo site_url( ”, ‘login’ ) ?>”

    Now when someone enters the wrong info the page simply refreshes and the form clears, instead of sending them to the wp-login form page. You could also create a new file with some information or instruction and insert the filename so that it looks something like this

    <?php echo site_url( ‘thenameofyourfile.php’, ‘login’ ) ?>

    and then the user will be redirected to that file.

    Profile photo of Gene53
    Gene53
    Participant

    @gene53

    @ozgirl57 Thanks, I’ll give that a try.

    BTW, could <?php echo site_url( ‘thenameofyourfile.php’, ‘login’ ) ?> be used to simply display a message such as “Oops, you have entered an incorrect username or password, please try again” in a page (instead of a PHP file) and change the ‘thenameofyourfile.php’ to the page slug?

    Thanks,

    Gene

    Profile photo of Gene53
    Gene53
    Participant

    @gene53

    Hmm, how do I get my page slug inside <?php echo site_url( ‘thenameofyourfile.php’, ‘login’ ) ?> to replace thenameofyourfile.php?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stop redirecting to the WP login page?’ is closed to new replies.
Skip to toolbar