Avoiding the use of wp-login.php (3 posts)

  1. Fleuv
    Posted 2 years ago #

    Hi there,

    I tried to avoid the use of wp-login by adding a login form to a page on my site and by adding this code to my theme it's functions.php

    function remove_wplogin() {
    	global $pagenow;
    	if ( 'wp-login.php' == $pagenow ) {
    add_action( 'init', 'remove_wplogin' );

    This code redirects all incoming traffic to wp-login.php to my new login page what got the page id 218.

    Bugs occurred..
    First of all logging out isn't possible any more because the function wp_logout_url() uses wp-login.php by default (same for logging in). All other default redirects like this one, go to: ../wp-admin without being logged in as admin, this will redirect back to wp-login.php (I might be wrong about this)

    Does someone know how to fix this or is it not possible to change (without modifying wordpress core)

  2. Rod Whiteley
    Posted 2 years ago #

    wp_logout_url() applies logout_url filters so that you can change the URL. wp_login_url() does the same kind of thing.

  3. Fleuv
    Posted 2 years ago #

    By filtering logout_url you'll be able to change the URL. But not every custom URL has a statement or something, scripted on custom.php?action=logout

    I've found out how to change it but I decided to leave it behind, but perhaps I'll comeback later on it.

    This answer is explaining what I'm trying to say. Only I don't know if it works correctly

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.