Title: Max post per user
Last modified: August 9, 2019

---

# Max post per user

 *  [Gustav](https://wordpress.org/support/users/4ever16/)
 * (@4ever16)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/)
 * Im using a front end post plugin where users can post directly from front page.
   
   I want to limit users from posting more then 5 posts but i dont know how to.
 * I want something backend so it works with the front end post plugin. So i can
   place the code inside the plugin.
 * When users tries to post his 6 post it will redirect or give an error message
   saying you reached maximum post limit or something.
 * I have tryied limit post plugin and it didnt work: [https://wordpress.org/plugins/limit-posts/](https://wordpress.org/plugins/limit-posts/)

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

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/#post-11816459)
 * >> Im using a front end post plugin <<
 * Which one? Check with its developers as there may be hooks you can use to modify
   its behavior.
 *  Thread Starter [Gustav](https://wordpress.org/support/users/4ever16/)
 * (@4ever16)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/#post-11816495)
 * Im using djd-site-post plugin: [https://wordpress.org/plugins/djd-site-post/](https://wordpress.org/plugins/djd-site-post/)
   
   It doesnt have support anymore.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/#post-11816504)
 * and it hasn’t been indexed by hookr.io [http://hookr.io/plugins/#index=d](http://hookr.io/plugins/#index=d)
 * That plugin is over 5 years out of date. You really should look into using something
   else.
 * If you want to keep using it, you’ll have to modify its code to get a number 
   of posts by the author and logic to decide what to do when the count exceeds 
   your limit.
 *  Thread Starter [Gustav](https://wordpress.org/support/users/4ever16/)
 * (@4ever16)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/#post-11819929)
 * Ok still not solving it.
 * So lets think.
 * Get user post count.
    If user post count 100 Do this else Do this
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/#post-11820137)
 * That’s pretty much it
 * But I’d look for a different plugin for front end posting, one that has support.
 *  Thread Starter [Gustav](https://wordpress.org/support/users/4ever16/)
 * (@4ever16)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/#post-11820804)
 * Ok so i put this code in the front end plugin and it shows correct.
 * If i have more then 10 posts it shows >10.
    If less then 10 posts it shows <10.
 * Maybe i can come around this in some one?
    Does someone has an idea? Like if 
   >10 hide widget.
 *     ```
       <?php
       $count = count_user_posts( $current_user->ID );
       $current_user = wp_get_current_user();
   
       if ( $count >= 10) {
   
           echo ">10";
   
       } else {
   
           echo "<10";
   
       }
       ?>
       ```
   

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

The topic ‘Max post per user’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [Gustav](https://wordpress.org/support/users/4ever16/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/max-post-per-user/#post-11820804)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
