Support » Plugins » Hack the user’s dashboard option

  • I didn’t find any plugin that would allow me to restric users/per level acces to the secction of the dashboard panel when they login.
    For example, for a specified category of users i want to disable the ability to acces the comments section of the panel when they are loged in, as they can see the IP and E-mail adress of all the coommenters. So what is the best solution to do that?

    Thanks in advance!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thanks for the links but, they didn’t help me much, the first one just hide the dashboard (wich can still be accesed by direct link)and is not what i want. The second one seems much more powerful but i don’t know what codes to write for the desired results. What i want is to restrict users with Author level from accesing the Manage, Comments etc section when they are loged in.
    I want they only to be able to publish post, manage theyr post/profile and that’s all. I don’t want them, for exemple, do be able to acces the Comments section and be able to see the commenters IP’s. And right now Authors (by default) are able to manage uploads as well, and they are able to browse all the uploads ( not only theyr’s) and change files url’s/dele them wich could resulte in the mess of the website.
    If anyone can help with some sugestions, i would be very greatful!

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    WordPress has “Roles” and “Capabilities”. This plugin will let you adjust them to define what you want each role to be capable of doing. When you do this, the appropriate options will be available to each user, depending on their capabilities.

    This seems to be the million dollar question that nobody can or will answer. I’ve been searching for this solution for weeks now.

    Every time Role Manager is pointed to as the solution, however Role Manager lumps editing your own comments with other people’s comments and thus you can see everyone’s IP and email addressed, thus the purpose is defeated.

    I read in one spot that Role Manager can start trashing a ‘data file’. I tried deactivating/deleting/reuploading/reactivating it but still no changes.

    I want to enable authors to edit their own comments, but if that cannot be separated from editing everyone’s comments I would rather restrict them from edit-comments.php altogether.

    Unfortunately even Role Manger fails this because when you enable someone to publish their own posts they can also see the full edit-comments.php

    What am I and so many others doing wrong here?

    here is proof, i double checked it now to prove to myself i’m not crazy (at least on this topic)

    for one thing, nobody has made it clear there are two versions of role manager. owen winkler wrote an older one that does not work with WP 2.0 versions. The German link above is the correct one.

    I uploaded the German coder’s version, and created a new role with the only capability of reading. Logged into it, yep can only access dashboard and profile. Great.

    I added the capability “edit posts”, note i did not add the capability “edit others posts”. So I have “read” and “edit posts” as the only two capabilities. I double checked in both the role manager for this new role capabilities and in the specific test user/long for these two capabilities.

    Logged in under the test user, lo and behold I have access to write, manage, and COMMENTS!


    this capability is only supposed to allow ability to edit your own comments, not others.

    I quote:
    Manage->Comments — meaning: “show post”-link; “edit post”-, “edit comment”- and “delete comment”-links only on own posts since edit-comment.php ( looks for “current_user_can(‘edit_post’, $comment->comment_post_ID)”‘

    Perhaps the issue is this test user has no comments, and so it may not be able to show any and so errors by showing all? If so it’s not working correctly, it should show a no comments, not everyone’s.

    This test leads me to believe wordpress has an error in the core code that needs to be fixed in the next release.

    Please point out what I’m doing wrong and what an idiot I am, I beg you.

    I’m having the same problem. I would like to add a couple of subscribers to my site, but do not want them to have access to the comments section of the admin panel. The problem seems to be that “edit_posts” bundles access to write and manage with comments in the admin panel.

    I have tried both role managers and neither one can break up the “edit_posts” capability. Surely there is a way to do this.

    And, from what I’ve read, edit_posts is supposed to only display the person’s own comments. However this function seems broken and anyone with access to the comments can see everyone else’s comments.

    Is there anyway short of having to edit code that I can resolve this problem? I’m losing a lot of traffic and a couple of valuable resources by having to hold back my contributors over this.

    Dumb questions – why would anyone care if their email address and ip are visible? Stalkers? And…the comments are viewable as part of the site anyway. This seems to be a nit to me.

    The plugin works well, it complies with its promises, you will not want to return to play the tab comments. The only bad thing is that it’s ugly. Some changes must be made to self-worth not so ugly.

    To make it prettier you can change

    echo "<div class='wrap'><h2>Restricted area</h2></div>";


    wp_die( __( 'Your level is not high enough to view comments.' ) );


    From investigating, i can tell you theres no way at the moment to create a plugin to only show the comments of author posts and not allow them to see other comments, so i made some hacking instructions you can use (and i’m using on This hack will basically only show comments to a user that has permission to

      edit the post

    that the comment was made on. If you want to remove the IP address information, do it manually.

    This modifies a core file, so take note when upgrading.

    File to hack: wp-admin/edit-comments.php

    First part
    Search for this line:
    $class .= ('unapproved' == $comment_status) ? ' unapproved' : '';

    Put this on the next line:
    <?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?>

    Find this line:
    } // end foreach

    Put this on the next line:

    For the second part..
    You actually don’t need to edit another file. Instead of needing to edit template.php, you only need to edit the edit-comments.php further. Find this line:
    get_comment( $comment ); // Cache it

    And put the following on a new line after it:
    if ( current_user_can('edit_post', $comment->comment_post_ID) )

    There are two places you will need to put it.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Hack the user’s dashboard option’ is closed to new replies.