Version 1.4

WP Hide Dashboard version 1.4 was released on 6/26/2009 for WordPress 2.8.

Description: This plugin removes the Dashboard menu, the Tools menu, and the Help link on the Profile page, and prevents Dashboard access to users assigned to the Subscriber role. Useful if you allow your subscribers to edit their own profiles, but don't want them wandering around your WordPress admin section.

Users belonging to any of the other WordPress roles will continue to see the Dashboard link and the Tools menu, and have access to the other sections of the WordPress admin that corresponds to their role's capabilities.

What's New:

  • Added code to remove Tools menu in 2.8.x (menu numbering changed in core).
  • Added Frequently Asked Questions and proper Changelog sections to readme.txt file.

Screenshot:

WP Hide Dashboard, Version 1.4 (2.7/2.8)
Screenshot of the upper-left portion of 2.7/2.8 admin section

Note: Comments are closed for this version. Please update to the latest version of the plugin and post comments/questions on the page for that version.

45 Responses to Version 1.4

  1. por says:

    Uhm the fix (Fredelig - June 23, 2009 at 3:54 pm) for hiding tools doesn't seem to work for 2.8.2
    Is there another way or a new number ?

    thanks.

    Oh and althought I know this plugin isn't meant for it: Is there a way to hide the default 'posts' and 'title' fields and just use custumfields ?

    • Kim says:

      @por: Have you upgraded to the latest version of the plugin released last week (1.4)? That version does work in WP 2.8 through WP 2.8.1-beta2 (there is no WP version 2.8.2). If you changed the roles that this plugin hides the Dashboard link, etc. from, you'll need to make those changes again. See the newly-added FAQ section above for the correct code to change the roles.

      As far as hiding the default posts and title fields, this plugin does not have that capability. Are you wanting to hide them on the New Post/Edit Post screens?

  2. Nnyan says:

    Weird,

    My default level (contribs) are still seeing the TOOLS menu. I've made the changes outlined in the FAQ. Any ideas?

    Thank you

    • Nnyan says:

      Just had some really weird issues where my "post" box (where a user can write a new post" would disappear. After much hair pulling there seems to be some conflict between this plugin and Role Scoper. In the end I had to disable both in order to give users the ability to post. /sigh.

      • Kim says:

        Nnyan: There seems to be a conflict between my plugin and the Role Scoper plugin, but I haven't had time to investigate further to find the source of the conflict.

        If you disabled one of the plugins (either Role Scoper or mine), did you still have the issue with the post box?

  3. James says:

    SAL said:
    For some reason, after activation of this plugin Subscribers are still seeing Profile menu (which is fine) as well as Settings (which only has PHP Speedy Plugin showing) and a Pods (a plugin) top level menu item.

    I guess I can add code for the specific unset menu[x] for the "Settings" and "Pods" menu, but how do I find out what the related mneu numbers are?

    Is there another way to do this?

    Did anyone find a solution for this I have the same problem, I too can't seem to hide the settings with PHP speedy in.
    Thanks & Great work by the way.

    • Kim says:

      SAL and James: To hide the Settings menu in WordPress 2.8.x, you'll need to add the following to my plugin after line 74:

      unset($menu[80]);		/* Hides Settings menu in 2.8 */

      For the Pods menu, add the following directly after the line of code above:

      unset($menu[9999]);		/* Hides Pods menu in 2.8 */

      Please note, if there are any other plugins you're using that also make use of the 9999 menu number, they will also be hidden from subscribers.

  4. Ali says:

    I did that look into the core wordpress file menu.php you will find almost all of the ids there

  5. Ali says:

    I did that look into the core wordpress file menu.php you will find almost all of the ids there it is in the wp-admin folder

  6. B.B. says:

    Thanks for creating this great plugin! I have a question:

    Since subscribers only have access to their profile...how do you change the "Site Admin" link text to say "My Profile" on the default Meta sidebar widget? I'm afraid the "Site Admin" text will confuse subscribers. Thanks!

    • Kim says:

      B.B.: You would have to modify a core WordPress file to change that text. Instead of the Meta sidebar widget, why not use the Sidebar Login plugin to provide a login form and the logged in links for users.

      I've given instructions earlier in the comments on how to hide the Dashboard login link from everyone except the admins when using the Sidebar Login plugin. You can name the profile link to anything you please while configuring the plugin.

  7. Mamoun says:

    Thank you very much for the fantastic plugin.
    I have a situation that may look somewhat strange. I need to hide only the tools and help menus but not all of the dashboard from users above subscribers and below admins. Is there any hack that I can apply?
    Thanks.

    • Kim says:

      Mamoun: That would require some additional code in my plugin. I've not had the time to work on this as of yet, but will let you know if I come up with a solution for you.

  8. Quinn says:

    When using this plugin in combination with CYC (Customize your Community), when a subscriber tries to logout I receive an error.

    I am using a dummy subscriber, and I can't get out without removing the cookies in my browser.... Any fix for this?

    • Kim says:

      Quinn: I've taken a look at the CYC plugin, and I don't believe that error is coming from my plugin, as mine has nothing to do with the logout process. Have you contacted the author of CYC (Joost de Valk) with your issue to see what he has to say?

  9. Gert says:

    plugin works fine, allthough the menu for "wp contact form 7 plugin" remains in the admin menu bar. how can i find the menu-number for this plugin?

    e.g. how did you know it was 9999 for the pods menu?

    • Kim says:

      @Gert: To find the menu number for the Pods plugin, I had to search the plugin files until I found the following line (was in init.php):

      add_action('admin_menu', 'pods_menu', 9999);

      I just took a look at the Contact Form 7 plugin. That line appears in admin/admin.php (line 109), but does not specify a menu number in the code. Try changing that line to:

      add_action( 'admin_menu', 'wpcf7_admin_add_pages', 9999 );

      Let me know if that change removes the link for that plugin from the menu for your subscribers. If it does, you might suggest to the author of that plugin that they make the change in the plugin; otherwise, you'll have to edit it every time they issue an update to their plugin.

      • Gert says:

        @Kim: unfortunately it doesn't...

        • Kim says:

          @Gert: From looking at the screenshots for the plugin, the link is located in the listing under the Tools menu heading, which should already be hidden from your subscribers. Can you take a screenshot of the menu portion of your admin section that shows where the plugin link is showing up, upload it to the web somewhere, and post a link to it here?

          • Gert says:

            @Kim: in a previous version the menu was indeed located under the tools section. Now, in the latest version, i quote: “The menu for Contact Form 7 management has been moved to the top level.” The screenshot you find on the plugins webpage is outdated. See my screenshot: http://www.emigrant.be/cf7.gif (menus in dutch). I have contacted the plugin owner but so far no response yet.

            • Kim says:

              @Gert: Thanks for the screenshot. From what I see, you are using my plugin to hide the dashboard, tools, etc. from both contributors and subscribers. Is that correct?

              I've installed Contact Form 7 this morning and have been working on hiding the plugin's top-level menu link for both contributors and subscribers, and have figured out a fix for you. However I need to know what roles you want to have access to that plugin (admin only, admin and editor, etc.). Let me know and I'll post the fix for you.

  10. Gert says:

    @Kim: thanks for helping me out on this.
    I have only 2 roles on my site: admin (only me) and contributors.

    I had to change the code of your wp hide dashboard plugin a little:

    if (!current_user_can('level_2')) {
     
    if (0 = wphd_hide_dashboard_version('2.7')) {
     
    unset($menu[0]);  /* Hides Dashboard menu */
    unset($menu[4]);  /* Hides arrow separator under Dashboard link in 2.7+ */
    unset($menu[10]); /* Hides the media menu */
    unset($menu[25]); /* Hides the comments menu */
    unset($menu[55]); /* Hides Tools menu in 2.7 and 2.7.1 */
    unset($menu[75]); /* Hides Tools menu in 2.8 */
    		}
    	}
    • Kim says:

      @Gert: Sorry for the delay in responding. I've got the fix worked up for you.

      In the Contact Form 7 plugin, you need to edit the file contact-form-7/admin/admin.php, lines 102-106, to read as follows:

          add_menu_page( __( 'Contact Form 7', 'wpcf7' ), 8, __( 'Contact Form 7', 'wpcf7' ),
              WPCF7_ADMIN_READ_CAPABILITY, __FILE__, 'wpcf7_admin_management_page' );
       
          add_submenu_page( __FILE__, __( 'Edit Contact Forms', 'wpcf7' ), 8, __( 'Edit', 'wpcf7' ),
              WPCF7_ADMIN_READ_CAPABILITY, __FILE__, 'wpcf7_admin_management_page' );

      From the code snippet you included from my plugin, it looks like you're using an older version. I've made the needed changes to the current version (1.4), so you should upgrade to that and make the following changes:

      To hide from both the Subscriber and Contributor level, change !current_user_can('edit_posts') to !current_user_can('upload_files') in all three places it occurs (lines 52, 67, and 82).

      Then replace the code on lines 71-74 with the following:

                  unset($menu[0]);        /* Hides Dashboard menu */
                  unset($menu[4]);        /* Hides arrow separator under Dashboard link in 2.7+*/
                  unset($menu[10]);        /* Hides the media menu */
                  unset($menu[25]);        /* Hides the comments menu */
                  unset($menu[55]);        /* Hides Tools menu in 2.7 and 2.7.1 */
                  unset($menu[75]);        /* Hides Tools menu in 2.8 */
                  unset($menu[9999]);    /* Hides top-level menu for Pods plugin in 2.8 */

      That contains all of your existing changes plus adds the fix to hide the top-level menu for the Pods plugin.

      All of these changes are assuming that you are using WordPress 2.8.2, but should also be backwards compatible to 2.7.x.

      Let me know if these changes fix the issue for you.

      • Gert says:

        @Kim: thanks! that hides the contact form 7 menu..

        just one final question: i upgraded to wordpress 2.8.2 and now appears the menu item "new post" in the upper right corner of the admin-screen. see screenshot: http://www.emigrant.be/pic123.gif
        This menu shows 2 submenus: concept and upload
        Concept doesn't bother me, but upload does, since i have allready hidden the media menu using unset($menu[10]); /* Hides the media menu */
        Is there any way to hide this whole menu?
        Thanks.

        • Kim says:

          @Gert: That issue is pretty simple to take care of. Edit my plugin and replace lines 50-55 with the following code:

          /* Hide help menu */
          function wphd_hide_help_link() {
          	if (!current_user_can('upload_files')) {
          		echo "n" . '#screen-meta, #favorite-actions { display: none; }' . "n";
          	}
          }

          It looks like the author of Contact Form 7 has released a new version. Remember to make the changes to contact-form-7/admin/admin.php to hide that link again.

          Let me know if there's anything else I can help with.

          • Gert says:

            @Kim: thanks that works just fine. I think that covers it all. i have disabled everything a contributor shouldn't click on (at least in my opinion).
            Thanks for your help!

  11. webmaster says:

    perfect. was what i was looking for. working on 2.7.1 version without problems

  12. This is perfect. Thank you. (Tested in 2.8.4.)

  13. Nick says:

    Great! plug in, Works perfectly in wordpress 2.8.4, I followed your instructions to hide the dashboard from contributors and it works fine, but it shows the comments tab in the sidebar, is there anyway to remove that?
    other than that, REALLY good plug in

  14. Ryan says:

    I'm having trouble with the Contact Form 7 menu (v2.0.2). I've replaced what looks like the correct code in the admin.php file (lines 102-106 don't look anything like the replacement code, but lines 119-125 do). If I replace the lines on 119-125, the Contact Form button disappears for all users. If I replace the lines on 102-106, the button remains for all users, but the submenu ("Edit") disappears.

    Could you post the code that needs to be replaced, so I can be sure I'm doing this correctly?

    Thanks!

    • Kim says:

      @Ryan: My apologies for the delayed response. I've just now found the time to look into this.

      The latest version of Contact Form 7 (2.0.7) breaks the fix I listed above. In order to hide this plugin's top-level menu link from everyone except the admin, you'll need to make the change listed below.

      Open contact-form-7/wp-contact-form-7.php and edit lines 61-65 to read as follows:

      if ( ! defined( 'WPCF7_ADMIN_READ_CAPABILITY' ) )
      	define( 'WPCF7_ADMIN_READ_CAPABILITY', 'manage_options' );
       
      if ( ! defined( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY' ) )
      	define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'manage_options' );

      This change will increase the access level from contributor/author to admin only for this plugin. The plugin author had set the read capability to the contributor role (edit_posts) and the read/write capability to the author role (publish_pages).

      Let me know if you are still having problems after making this change.

  15. James says:

    wp-hide dashboard plugin is very good idea but I want that plugin to add "Post" to show up in panel. I need it for authors to use Post to create their new message.

    can you make new plugin for Profile and Post in panel for authors???

    thanks

    • Kim says:

      @James: To accomplish what you are asking, I would recommend that you try the Admin Menu Editor plugin. With that, you will be able to set permissions for each area of the admin section to the level you desire.

  16. Bong says:

    congrats Kim, for this wonderfull plugin, just what I was looking for!
    But I have a question : how to remove the link "Turbo" wich is at the top of the dashboard page?

    • Kim says:

      @Bong: To hide the Turbo link in the header, you need to change line 53 of the plugin (version 1.4) from this:

      		echo "n" . '#screen-meta { display: none; }' . "n";

      to this:

      		echo "n" . '#screen-meta, .turbo-nag { display: none; }' . "n";
  17. PauLoX says:

    Add this for redirect turbo link:

    if (!current_user_can('edit_posts') && $parent_file == 'index.php' || $parent_file == 'tools.php') {
    • Kim says:

      @PauLoX: I'll test your code and probably will include it in the next release.

      Update (12/24/2009): I've done some initial testing with this code and it does work; unfortunately it works too well - it also causes the Tools page to redirect for other roles, including the Admin role. I'll test it further and try to resolve that issue.

  18. Roni says:

    Hi, The plugin is great, works well except one problem:
    i can hide the dashboard menu but not the dashboard items in the main screen.

    could you advise how can i troubleshoot such problem?

    I have the following plugins active:
    Flutter, Qwerty Admin Panel Theme, and WP Hide Dashboard

    I use WordPress 2.8.6.

    Thank you.

    Roni

    • Kim says:

      @Roni: This plugin is not designed to remove dashboard items in the main screen. It only removes the dashboard link from the menu in the left sidebar of the admin section.

      If you are using it at the default Subscriber role level, they will not see the Dashboard link and will be redirected back to their profile page if they attempt to access the dashboard by direct link.

  19. Ajay says:

    Thanks for the great plugin.

    I'm building a complex wordpress based website and I want to allow subscribers to edit the posts while all other options remains the same.

    How to do it?

    • Kim says:

      @Ajay: My plugin will not do what you are wanting - it is a simple way to hide certain WordPress admin areas from subscribers.

      Subscribers, by default, cannot do anything but read your blog. The first role that is permitted to edit posts is the Contributor role. You could simply change the role of your subscribers who are contributing content to your blog to Contributors, and they would be allowed to edit posts, delete posts and read.

      If you still want to keep those people's role set at Subscriber, take a look at the Members plugin by Justin Tadlock - it may help you accomplish your goal: Plugin page | WordPress.org page

      • Ajay says:

        Hi Kim,
        Thanx for the reply.
        Contributor role doesn't help me.
        I had a look at the memebers plugin as well but it is again same as contributor features if I allow edit capability.

        All I want is to hide everything except user's own profile edit and own post edit.

        Contributor role allows them to see other people's posts, comments and some other menus (E.g. GD star).

        Your plugin is perfect option for me if it lets Subscriber/Contributor to view their own posts/edit their own posts, while hiding everything else as pluging does normally.

        Would it be possible with your plugin?

        • Kim says:

          @Ajay: You cannot hide other authors' posts in the Edit Posts listing for Contributors. That is the default WordPress behavior, and the only way to change that is to modify core files. I do not advocate modifying core files, and won't help you do that. To my knowledge, there is no plugin that will change this either. Contributors cannot edit other authors' posts, only view them on the front-end of the site.

          There really is no harm in this, as they will be taken to the My Posts tab when clicking on Edit, not the All Posts view.

          I was mistaken in my previous response about contributors being able to edit posts/delete posts - they cannot do that. A contributor can add a new post, save it as a draft, edit it, and save it as Pending Review. Once the post is published, contributors can no longer edit those posts, only view them. If you want them to be able to edit published posts, then the contributor role won't work.

          I would highly recommend the following solution, as it will get you most of the behavior you are wanting without touching the default capabilities in the Subscriber or Contributor roles:

          Plugins needed:
          - Members (0.1.1)
          - WP Hide Dashboard (1.5 - just released today)

          1. Install/activate both plugins.

          2. Members plugin:
              a. Activate the Edit Roles and New Roles components.
              b. Assign the administrator role the edit_roles and create_roles capabilities.
              c. Create new role called Guest Author (guest_author).
              d. Give this new role the following capabilities:
                  - edit_posts
                  - edit_published_posts
                  - publish_posts
                  - read
              e. Assign the users that you wish to have these capabilities to this role. This will give them the ability to edit/delete their own posts (which contributors are unable to do). Do not edit the capabilities for the Subscriber or Contributor roles - leave those set at the default levels.

          3. WP Hide Dashboard plugin: Set $wphd_user_capability to 'manage_categories' (line 44).

Comments are closed.