Title: Draft posts appearing to users
Last modified: August 22, 2024

---

# Draft posts appearing to users

 *  [inkyone](https://wordpress.org/support/users/inkyone/)
 * (@inkyone)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/draft-posts-appearing-to-users/)
 * I have noticed that the users of my website have the possibility to view the 
   posts that have been left in the draft by the admin of the panel.
 * I am not sure what is the reason that this function is in this state, but it 
   seems to me that it is not right.
 * Or maybe I did something wrong that I am not aware of, if not, then it would 
   be good if someone from the developers would change this.
 * Thank you
    -  This topic was modified 1 year, 9 months ago by [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Anton Vlasenko](https://wordpress.org/support/users/antonvlasenko/)
 * (@antonvlasenko)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/draft-posts-appearing-to-users/#post-17967868)
 * It shouldn’t happen.
 * Are these users registered or guest users? If they are registered users, what
   role are they assigned?
 * Go to **Users > All Users** in your WordPress dashboard and check their roles.
   Only administrators and editors should have access to drafts.
    -  This reply was modified 1 year, 9 months ago by [Anton Vlasenko](https://wordpress.org/support/users/antonvlasenko/).
    -  This reply was modified 1 year, 9 months ago by [Anton Vlasenko](https://wordpress.org/support/users/antonvlasenko/).
 *  Thread Starter [inkyone](https://wordpress.org/support/users/inkyone/)
 * (@inkyone)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/draft-posts-appearing-to-users/#post-17972348)
 * Hey [@antonvlasenko](https://wordpress.org/support/users/antonvlasenko/) , thanks
   for the reply.
 * I see that I have set the users with the role of “Contributor” because I wanted
   the users to be able to create blog posts. I thought of just enabling the role
   of “Subscriber” but it seems, that with this role, the registered users, are 
   unable to make blog posts.
 * This leaves the role of a “Contributor” but still I just think that it’s inappropriate
   for the registered users to see what others have added to their draft.
 * I realized that they can even see when a post is scheduled!
 * Somehow I get it why this feature is added this way, but I cant think of any 
   good reason for Contributors having the ability to see on the Dashboard what 
   others have stored in draft.
 * Maybe this would be appropriate if the rank would be set as Moderator for the
   users!
 * …
 *  [Anton Vlasenko](https://wordpress.org/support/users/antonvlasenko/)
 * (@antonvlasenko)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/draft-posts-appearing-to-users/#post-17972610)
 * Sorry for the confusion. Yes, contributors can view other people’s draft posts;
   however, they can only see the titles, not the content. This is [expected behavior](https://core.trac.wordpress.org/ticket/8111).
 * Unfortunately, there is no quick and easy fix for this.
 * The solution below appears to restrict contributors from viewing other users’
   posts (they can only see their own posts in the admin area), but it doesn’t always
   work correctly, as it sometimes shows an incorrect post count in the admin panel.
 *     ```wp-block-code
       // Restrict contributors to only view and edit their own postsfunction restrict_contributor_posts( $query ) {    if ( ! is_admin() || ! $query->is_main_query() || ! current_user_can( 'contributor' ) ) {        return;    }    global $pagenow;    // Restrict contributors to only see their own posts in the post list    if ( $pagenow == 'edit.php' ) {        $query->set( 'author', get_current_user_id() );    }}add_action( 'pre_get_posts', 'restrict_contributor_posts' );
       ```
   
 * I’ve packaged it into a WordPress plugin so that you can install and try it. 
   However, I bear no responsibility for its use (please proceed **at your own risk**):
   [https://filebin.net/pq95kjuy25r1boop](https://filebin.net/pq95kjuy25r1boop)
    -  This reply was modified 1 year, 9 months ago by [Anton Vlasenko](https://wordpress.org/support/users/antonvlasenko/).
      Reason: improved code
 *  Thread Starter [inkyone](https://wordpress.org/support/users/inkyone/)
 * (@inkyone)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/draft-posts-appearing-to-users/#post-17973743)
 * Hey [@antonvlasenko](https://wordpress.org/support/users/antonvlasenko/) .
 * Thanks for this code but for now Ill just leave it as it is because I am not 
   that good with mingling with code scripts. Hopefully this will change by the 
   WP developers in the future and for now its good that there is a solution for
   when its most required.
 *  [Anton Vlasenko](https://wordpress.org/support/users/antonvlasenko/)
 * (@antonvlasenko)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/draft-posts-appearing-to-users/#post-17975418)
 * >  Hopefully this will change by the WP developers in the future and for now 
   > its good that there is a solution for when its most required.
 * [@inkyone](https://wordpress.org/support/users/inkyone/) To help ensure that 
   WordPress developers are aware that this issue is still affecting users, I encourage
   you to share your experience on the relevant Trac ticket. The issue you’re encountering
   with the display of other users’ post titles is being discussed in this Trac 
   ticket: [#8111](https://core.trac.wordpress.org/ticket/8111), this [comment](https://core.trac.wordpress.org/ticket/8111#comment:8)
   specifically.
 * By adding your comment to this ticket, you can help highlight the ongoing impact
   of this problem, which may prompt developers to prioritize a fix in future WordPress
   updates.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Draft posts appearing to users’ is closed to new replies.

## Tags

 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [registered users](https://wordpress.org/support/topic-tag/registered-users/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [Anton Vlasenko](https://wordpress.org/support/users/antonvlasenko/)
 * Last activity: [1 year, 9 months ago](https://wordpress.org/support/topic/draft-posts-appearing-to-users/#post-17975418)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
