Free Directory, Listing & Classifieds WordPress Plugin Support General HivePress Override user-login to use wp-login.php

Override user-login to use wp-login.php

  • Author
  • tonyjhughes


    I’m looking to use a 3rd party authentication provider (Auth0) which works by redirecting from wp-login.php to the authentication service. (Save’s me holding any passwords in my DB, only tokens!)

    Is there a way to override the user_login_page redirects so it goes to wp-login.php?

    I have already customised ‘user-login-link.php’ which has sorted the header link to the modal, however other links (such as ‘add listing’) redirect to the sign-up page when not authenticated.



    Try using this code snippet:

    	function() {
    		if ( function_exists( 'hivepress' ) && hivepress()->router->get_current_route_name() === 'user_login_page' ) {
    			wp_safe_redirect( 'custom url here' );

    But please note that this will break the front-end redirects, e.g. when user clicks on “Add Listing”, and then signs in, user is redirected to the first step of the listing submission process. If you redirect user to another login page there will be no redirect back, so there may be bad UX. Also, there’re a lot of links to the login popup added by extensions (e.g. favorites, messages).

    You can consider using the WordPress authentication to avoid these issues, it doesn’t store plain text passwords anyways, only hashes.


    Hi ihor,

    That works, I will need to check through all the other touch points where the modal is used and see if I can do anything there.

    I’ve just tested using the WP “redirect_to=” and this works so long as whitelist the return URI from within Auth0, which is a start! Looks like I have some work to do!

    Security wins over UX for me 🙂


    Or use a rock-solid password hashing like bcrypt.


    @letsgetdelivery – I may have to. I said security wins over UX but I ain’t going to make this work without a lot of customisation! Time to research hashing, I’ll look at bcrypt. And also see if there are any other tips out there on DB security.


    @tonyjhughes – am curious to know how it is coming along


    @unitehearts how did you put the whatsapp, Instagram icon on your listings card?


    @issab – i can see that you have asked this question here
    Post Link:
    I copied it from that thread only – you will see it written there


    @tonyjhughes can you please share how you changed the modal – as you said here “I have already customised ‘user-login-link.php’ which has sorted the header link to the modal”

    Please share – i have a similar issue.



    I guess @tonyjhughes meant overriding this template part and setting the login page URL instead of the modal URL


    @ihor – Thank you very much for replying.
    If I replace <a href=”#user_login_modal” with <a href=”my-custom-url/” then will this not be removed by an update of Hivepress ? How can I do it in a proper way to protect this from updates ?
    Please advise.


    You can override the template part without editing the plugin files, please check the instructions in this topic


    Hi Guys,
    Sorry, been busy with my actual job…

    – you were correct, I just changed it directly in user-login-link.php

    – I gave up on implementing Auth0 for user authentication for now. There’s are alot more touchpoints on the user journey where there’s either a login modal or link to login/register page.

    Places where these are: Header (login/my account); Reply to Listing; Add To Favourites; Listing Reply & Favourite buttons on the listing card..

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.


Sign In

Don't have an account? Register

Forgot password?


Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.