• gamicord

    (@gamicord)


    If I install:

    –Profile Builder plugin,

    — UsersWP,

    — Pie Register plugin,

    Redirection comes with those plugins as a default function.

    This means that if someone intentionally types https://mywebsite.com/wp-admin, or the person intentionally types https://mywebsite.com/wp-login.php, the person will always and forever be redirected to the Custom Login or Registration Pages of these plugins.

    The person can never ever see the wp-admin or wp-login.php pages.

    Now, I speak with such confidence for those plugins in this matter of Redirection, because I’ve used those plugins and they didn’t disappoint in the matter of redirection.

    THE CASE WITH ULTIMATE MEMBER ON REDIRECTION

    I typed wp-admin and wp-login.php, and I was shocked that I was still able to get to these pages.

    It means that you’ve not done a good job at redirection.

    Please, do you have Settings in Ultimate Member that can help me ensure that users can never ever have access to the WP-ADMIN and WP-LOGIN.PHP Pages of my website–even if they deliberately and intentionally type WP-ADMIN and WP-LOGIN.PHP into their browsers?

    2.) If this feature is not available in Ultimate Member, can you Please send me the PHP Code Snippets that can achieve it?

    Regards.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support andrewshu

    (@andrewshu)

    Hello @

    Try to use tis code:

    function um_admin_redirect_to_specific_page() {
        global $pagenow;
    	if ( ! is_user_logged_in() && $pagenow == 'wp-login.php' ) {
    		wp_safe_redirect( home_url().'/login' );
    	}
    }
    add_action('init', 'um_admin_redirect_to_specific_page');

    Regards.

    Plugin Support andrewshu

    (@andrewshu)

    Hi @gamicord

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

    Thread Starter gamicord

    (@gamicord)

    Yes, this Code worked well.

    And it actually did solve my issue.

    I do have codes that I use for WP Admin and WP Login redirects.

    The difference between those codes that I have, and this one you sent, is that yours looks better: it is shorter, looks more straight forward, and works well without any glitches.

    MY QUESTION IS:

    Can you try to add this Redirect Feature to Ultimate Member Core— where we can do the Page Redirect from Ultimate Member Page settings, and not need to use custom code as this to achieve it?

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirection of Wp-Admin or Wp-Login.php pages’ is closed to new replies.