WordPress.org

Ready to get started?Download WordPress

Forums

Disable dashboard for low-level users (12 posts)

  1. occamsrazor
    Member
    Posted 8 years ago #

    I need to be able to disable the dashboard completely (or at least most of it) for low-level users e.g. subscriber-level, but keep it for admin-level users...

    Anyone know a way? I looked through the plugins and this seemed closest, but the links are dead:

    http://wp-plugins.net/plugin/dashbar-k

    Thanks, Ben

  2. Austin Matzko
    Member
    Posted 8 years ago #

    What do you mean by the "Dashboard"? Do you mean just that one admin page that usually is at /wp-admin/ ? Or do you mean the entire admin control panel?

  3. occamsrazor
    Member
    Posted 8 years ago #

    For a low-level user what I would like is:

    1. When they hit return on the login page, instead of redirecting to the admin-interface, it redirects back to the website main page.

    2. When they click the Site-Admin link, it takes them to their User-profile page, but they don't see the Dashboard bar on the left, only the Users bar.

    Hope that makes sense... Many thanks,

    Ben

  4. occamsrazor
    Member
    Posted 8 years ago #

    Basically a lot of my users will need to be logged-in to access a private area of the site, but don't need to be directed to the User-profile page each time they log in. And when they do go to the User-Profile page, there is no need for them to have access to the Dashboard page. Regards, Ben

  5. occamsrazor
    Member
    Posted 8 years ago #

    But for admin-level users it should preferably behave as normal...

  6. ElmoFromOK
    Member
    Posted 7 years ago #

    Did you find a solution to this? I have this same need?

  7. cewebster
    Member
    Posted 7 years ago #

    FWIW, this is how I solved this on a modified K2 site. I will have several authors and public commenters will be required to register as subscribers. I just changed the login redirect and site admin tab and the dashboard privileges and that took care of it without a lot of work. The login redirect now goes to the main blog page and the admin tab reads "My Profile" and goes to the profile page instead. Novice type users never have to deal with the dashboard, though I can get there if I need to. The following cites the line changed and which file it was in:

    1) Changed line 170 of wp-login.php to

    $redirect_to = 'index.php';

    ((I changed wp-admin to index.php))

    2) Changed line 7 of /wp-admin/menu.php to

    $menu[20] = array(__('Dashboard'), 'read', 'index.php');

    ((I changed value from 0 to 20. I also saw where someone had changed 'read' to 'manage_options' instead.))

    3) Changed line 47 of template-functions-general.php to:

    $link = $before . '' . __('My Profile') . '' . $after;

    ((I changed /wp=admin/ to /wp-admin/profile.php/ and Site Admin to My Profile.))
    ETA that part of the above code turns into a link after posting on the forum and is confusing. Here it is hopefully more as it appears, I just took out the expected <> around the "a" tags and replaced with ^:

    $link = $before . ' ^a href="' . get_settings('siteurl') . '/wp-admin/profile.php/"^' . __('My Profile') . '^/a^' . $after;

    This was the simplest approach and worked great for us. The login going to the blog's home page makes more sense to everyone. The commenters and the other people who write posts at our org can click on “my profile” after they log in and go to something familiar that makes sense, without being thrown by landing at the dashboard. I just let people sign up on their own and change the roles of internal people who want to post for them.

    It’s pretty easy maintenance. WordPress rules. Note that I am not an expert and can't guarantee this nor can I help you fix it if you break it. I did this without breaking my site tho and of course you should always back up the files first.

    If you want to see it in action, go to http://dce.unm.edu/dceblog

  8. croila
    Member
    Posted 7 years ago #

    I did away put having a separate login page. I put the username and password entry boxes in the sidebar, and the user does not get directed to the dashboard at all, but rather stays on the same page.

    Like you, however, I have a site where people have to be able to see certain content if they're logged in, but I don't really want them doing much else there.

    If his userlevel is the most basic, only a logout link is displayed, plus a link for him to get to his profile page so he can change his password. He sees no link for the dashboard or site admin.

    If, however, the user has contributor status, he logs in and whilst he stays on the home page, he now sees a link for site admin as well as logout and his profile page.

    I've pasted my sidebar code here - hope it may be of some use to you.

  9. schneis
    Member
    Posted 7 years ago #

    croila - your link (http://croila.pastebin.co.uk/4399) is broken.

    Can you fix it?

  10. sphereboy
    Member
    Posted 7 years ago #

    Thank you! "cewebster"

    Your small tutorial has saved me from gruesome research. I have implemented your edits and all is working properly. My client will be satisfied that I was able to simplify the log in process. I couldn't understand what he meant, until i signed on as a "regular" user to see that the dashboard and login sequence is a bit intimidating. Makes much more sense to redirect to the home page. Thank you again!

  11. webophir
    Member
    Posted 7 years ago #

    For WordPress 2.1.x, Disabling Dashboard is much easier.
    Open 'menu.php' under wp-admin.php.
    The very first line of code is

    $menu[0] = array(__('Dashboard'), 'read', 'index.php');

    The 2nd argument is the user permission - 'read' permission has default registered user.
    Change 'read' to other user level such as 'edit_users' if you want make Dashboard only visible to Admin privilege.

    $menu[0] = array(__('Dashboard'), 'edit_users', 'index.php');

    Now default registered users only have one option - Profile.

  12. volkeransmann
    Member
    Posted 7 years ago #

    Hi all,

    i changed almost every path to wp-admin I could find in wp-login and some other files in order to prevent users from seeing the WP Admin. That works fine for already registered Users. After those log in they are redirected to where they are right now. But if a new user signs up and then logs in for the first time - he is still redirected to the Dashboard. But only for the first login.

    any solutions for that?

    Thanks...

Topic Closed

This topic has been closed to new replies.

About this Topic