Home / Admin / Redirect Lost Password to a Custom Page
Duplicate Snippet

Embed Snippet on Your Site

Redirect Lost Password to a Custom Page

By default, some plugins redirect the “Lost Password” link to the WordPress admin panel.
This snippet forces the lost password page to redirect to any custom URL you want.
Simply replace the URL in the code with your own destination page.

Pharmacy Needs
<10
Code Preview
php
<?php
add_action('login_form_lostpassword', function() {
    if (isset($_GET['action']) && $_GET['action'] === 'lostpassword') {
        wp_redirect('https://your-custom-url.com/');
        exit;
    }
});

Comments

Add a Comment