Title: Expire Draft Posts Only
Last modified: August 21, 2016

---

# Expire Draft Posts Only

 *  Resolved [Mystech](https://wordpress.org/support/users/mystech/)
 * (@mystech)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/expire-draft-posts-only/)
 * Any way to have this plugin only expire older posts that are in the Draft state(
   all categories), leaving Published posts alone? Thanks.
 * [http://wordpress.org/plugins/auto-prune-posts/](http://wordpress.org/plugins/auto-prune-posts/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [ramon fincken](https://wordpress.org/support/users/ramon-fincken/)
 * (@ramon-fincken)
 * [12 years ago](https://wordpress.org/support/topic/expire-draft-posts-only/#post-4567768)
 * Sure!
 * You will have to change this part:
 *     ```
       if($cat_id > 0)
       					{
       						// Do only the last 50 (by date, for 1 cat)
       						$myposts = get_posts('category=' . $cat_id.'&post_type='.$the_type.'&numberposts=50&order=ASC&orderby=post_date');
       					}
       					else
       					{
       						// Do only the last 50 (by date, ALL)
       						$myposts = get_posts('post_type='.$the_type.'&numberposts=50&order=ASC&orderby=post_date');
       					}
       ```
   
 * the get_posts() will retrieve published posts by default, feel free to alter 
   this to draft, more info at
    [http://codex.wordpress.org/Template_Tags/get_posts#Usage](http://codex.wordpress.org/Template_Tags/get_posts#Usage)

Viewing 1 replies (of 1 total)

The topic ‘Expire Draft Posts Only’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/auto-prune-posts.svg)
 * [Auto Prune Posts](https://wordpress.org/plugins/auto-prune-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auto-prune-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auto-prune-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/auto-prune-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auto-prune-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auto-prune-posts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ramon fincken](https://wordpress.org/support/users/ramon-fincken/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/expire-draft-posts-only/#post-4567768)
 * Status: resolved