“Lost password” page triggers 404

I have a WP 4.5.3 with Wiz theme and two other plugins (other than the ones bundled with Wiz): WP Customer Area and WP-Members.

https://www.ukulele.it/wp-login.php

Try clicking “Lost password”, you get a 404. I’ve googled for the problem, and the results suggest a plugin conflict. I’ve tried disabling both of the user-management related plugins, but the 404 error is still there.

How do I reset the “change password” page to the WP default one?

EDIT AFTER birgire’s ANSWER:

I’ve added the suggested code to discover the resposible plugin, e.g.:

add_action( 'login_footer', function() use ( &$wp_filter )
{
    if( isset( $wp_filter['lostpassword_url'] ) )
        printf( '<!--%s-->', print_r( $wp_filter['lostpassword_url'], 1 ) );
});

In the login page source now I get:

<!--Array
(
    [10] => Array
        (
            [wc_lostpassword_url] => Array
                (
                    [function] => wc_lostpassword_url
                    [accepted_args] => 1
                )
        )
)-->

That means that in my case WooCommerce is to blame (or myself for a broken WooCommerce configuration).

1 Answer
1

Your theme or plugins are most likely modifying the “Lost password” link on your wp-login.php via the lostpassword_url filter.

How do I reset the “change password” page to the WP default one?

One would need to remove those filters callbacks.

Here’s one (untested) suggestion:

add_filter( 'lostpassword_url', function( $url, $redirect )
{
    remove_all_filters( 'lostpassword_url' );

    return wp_lostpassword_url( $redirect );
}, PHP_INT_MAX, 2 );

Otherwise one could search the install for add_filter( 'lostpassword_url' or peek into the $wp_filter global array. Here’s an example:

add_action( 'login_footer', function() use ( &$wp_filter )
{
    if( isset( $wp_filter['lostpassword_url'] ) )
        printf( '<!--%s-->', print_r( $wp_filter['lostpassword_url'], 1 ) );
});

that should print out the information as an HTML comment on the login page.

Leave a Comment