How to Limit Authors to their Own Posts in WordPress Admin

If you run a multi-author site, then you know that the post screen can get a bit crowded. Recently one of our users asked if it was possible to limit the WordPress posts screen to only show authors their own post. In this article, we will show you how to limit authors to only view and manage their own posts in WordPress admin.

First thing you need to do is install and activate the Manage/View Your Posts Only plugin. This plugin works out of the box, and there are no settings for you to configure.

If you are logged in with an administrator user role, then you will be able to see all the posts on your site. Users with other user roles will only be able to see their own posts.

How to Allow Editors to View All Posts

The problem with the plugin mentioned above is that it only allows administrators to view all posts. Many WordPress sites have editors responsible for proof-reading articles submitted by other authors and guest contributors. Using this plugin will restrict editors to only their own posts.

In this situation, the plugin we mentioned above will be useless for you.

Instead, you can add this code in your theme’s functions.php file or a site-specific plugin.

1
2
3
4
5
6
7
8
9
10
11
12
13
function posts_for_current_author($query) {
    global $pagenow;
 
    if( 'edit.php' != $pagenow || !$query->is_admin )
        return $query;
 
    if( !current_user_can( 'edit_others_posts' ) ) {
        global $user_ID;
        $query->set('author', $user_ID );
    }
    return $query;
}
add_filter('pre_get_posts', 'posts_for_current_author');

This code allows any users with the capability to edit other’s posts to view all posts. This means editors and administrators will be able to see all posts. Users with other roles like contributor or authors will only see their own posts.

If you are using custom user roles on your site, then you need to keep in mind that users who can edit posts added by other users will also be able to see them.

  • That’s all, we hope this article helped you learn how to hide posts from other authors in WordPress admin area. You may also want to take a look at our tutorial on how to hide unnecessary items from WordPress admin with Adminimize.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!

Pin It on Pinterest

Add address