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.
Video Tutorial
If you don’t like the video or need more instructions, then continue reading.
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.
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+.
Thank you! Lifesaver!
You’re welcome
Exactly what I was looking for. No custom code was needed.
Glad our guide was helpful
Works like a charm, many thanks
Glad our guide could help
Your code working perfectly. Thanks!!!
You’re welcome
Your recommended plugin is already outdated, any other reliable plugin?
This article was last updated in 2015, we will be sure to look for an alternative and update this article when we are able.
It works for all post types?
If you’re using the plugin you would need to reach out to the plugin’s support for that specific question.
Does the code mentioned in this article work with all post types? I have some custom post types on a clients site and the plugin worked we do not have time to test the site right now after adding more code and we are trying to allow editors to view all posts.
Thank in advance for your help!
How to filter out comments according to currently logged in user?
I want to restrict listing of all comments for the contributor. I want to allow showing and moderation option only for those posts which belong to them.
Same question, how hide comment also from other user.
Does this plugin include hiding of “pages” from non-authors? I see everything listed here says posts but would pages be included in that? Our site uses pages more than posts.
How to hide comments from contributers in wordpress dashboard ???
Hey there,
is there a way to exclude specific Post Types from that query ?
regards Tom
What if i have multiple admin and i want admin’s can see only their posts ??
very useful thanks
Works great. The other problem I have is that it still displays the post count for other users. So for example there are 105 published posts even if the current user only has 2 published posts.
Any idea how to rectify this?
I realise this is months later so I guess the reply is really for others with the same problem. Try adding this to your functions.php. Think I got it on WordPress.StackExchange.com >>
// Remove Post Counts
// Create a specific hook
add_filter(“views_edit-post”, ‘custom_editor_counts’, 10, 1);
function custom_editor_counts($views) {
// var_dump($views) to check other array elements that you can hide.
unset($views[‘all’]);
unset($views[‘publish’]);
unset($views[‘pending’]);
unset($views[‘trash’]);
return $views;
}