Support » Plugin: HC Custom WP-Admin URL » Users directed to admin section instead of site

  • Resolved MaxWendkos


    Hey there, need help with one more issue I’m having.

    When a user logs in, she’s being directed to the WP-admin panel instead of the website itself. All of my site’s users are just subscribers and there’s no reason for them to ever see the WP-admin panel at all. Is there a way for me to have the log-in page direct to the domain instead of the wp-admin panel? (I’d like WP-admin to only be accessible when a user is logged into and enters into the URL bar.)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Some Web Media


    As far as I know, its by WP default to redirect to dashboard after loging in from wp-login.php

    Try this:

    function redirect_users() {
        // retrieve current user info
        global $current_user;
        // If login user role is Subscriber
        if ($current_user->user_level == 0) {
    add_action('admin_init', 'redirect_users');

    Be aware that will not be accessible when using our plugin, because its sole purpose is to hide that url from possible hackers. You have to use new url you created for logging in.

    So with the solution above, you’ll be able to redirect subscribers to home and let admins to dashboard.

    Hope this solves your problem. has still been working for me even with your plugin installed. Currently:

    • When a user is logged in, directs her to the website and directs her to the dashboard.
    • When a user is logged out, and both direct her to (where she can log in).
    • When a subscriber logs in, she is directed to
    • When an admin logs in, she is directed to

    From what you’ve said, sounds like that means the plugin isn’t working how you intended it to. (Perhaps this was caused by the changes we made to the Basic Authentication code a couple days ago?)

    As for the code, where should I put it? I’m working with a child theme.

    Plugin Author Some Web Media


    The plugin is working perfectly, but as in the first case, its interfering with “Basic Authentication” plugin which is responsible for redirects.

    If you just want to redirect subscribers to home after login, just put the code I’ve provided to functions.php and it should work.

    The thing is that our plugin is for security purposes only, and as I understood it, you just want to change the url of the wp-login. So yeah it will work for you, but there could be much easier solution just to write function that rewrites the wp-admin url without any security checking.

    Got it. I meant to say that the plugin wasn’t working as you’d intended it to for me (because of the Basic Authentication conflict), not in general.

    I copied your instructions and they did fix the re-direct issue. Thank you.

    Also, while I did want to change the wp-login, I am also interested in the security as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Users directed to admin section instead of site’ is closed to new replies.