Support » Fixing WordPress » Deny Access to Dashboard for Subscribers

  • How can I hide the dashboard from regular subscriber users? All I want them to see is their profile (and extended profile) pages. I only want admin level users to see the dashboard.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m curious as to how this might be done as well. I don’t need my users to see incoming links, comment stats, or the latest wordpress news about security flaws I may or may not have updated.

    Ya, I did that, and did not find anything usefull

    FWIW, this is how I changed login redirect and site admin tabs on a modified K2 site. I will have several authors and public commenters will be required to register as subscribers. 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 using the browser address bar. The other posters have access to the write and manage tabs from their profile.

    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))

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

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

    ((I changed /wp=admin/ to /wp-admin/profile.php/ and Site Admin to My Profile. On code excerpt above I changed the <> around the a tags to ^ so that the code would show up here and not convert to a link.))

    This was the simplest approach and worked great for us. The commenters and the other people who write posts at our org can click on “my profile” 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.

    It’s pretty easy maintenance.

    I’m not an expert and can’t help you if this doesn’t work. It worked well for me tho and didn’t break my site. I also came across a caution that this is changing core code and would need to be redone after a wordpress upgrade.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Deny Access to Dashboard for Subscribers’ is closed to new replies.