Defender Login Redirect

I’m using a custom filter for my login form, it loads a custom form and I used a filter for login_url add_filter( ‘login_url’, array( $this, ‘overwrite_login_url’ ), 10, 1 );

Here is the code:
https://pastebin.com/8auXUTYM

When Defender Mask URL is enabled it redirects me to 404 page.

https://share.getcloudapp.com/9ZuWgoNl

It works fine for WPS Hide Login mask URL, but not for defender.

Can you help me?

  • Tho Bui
    • SLS

    Hey there Abruptive ,

    Default for security, if you enable the Mask Login, Defender will protect the link yoursite.com/login too. If you try another path it should be working. But I’m still not sure why you want to try using the custom login while enabling the Mask Login. Because if that, all everyone can log in from your custom form too, or all you want is disable wp-admin url and enable only the custom form?
    I also have prepared for you a snipped code that you can use as a guide here:
    https://gist.github.com/wpmudev-sls/eddfa45c65d1756306de9021c77a24c2
    You can download a zip, unzip it and upload file wpmudev-defender-allow-login-url-while-using-mask-login.php to your wp-content/mu-plugins folder. If that folder doesn’t exist you can simply create it.
    But notice, this still has an issue, if you open the source you will see the mask login URL here.

    If you are not familiar with mu-plugins you can read about them here:
    https://wordpress.org/support/article/must-use-plugins/

    Kind regards,
    Tho Bui