Title: Published-to-draft bug
Last modified: August 21, 2016

---

# Published-to-draft bug

 *  Resolved [Biranit](https://wordpress.org/support/users/biranit/)
 * (@biranit)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/published-to-draft-bug/)
 * Hi Donncha,
 * I think there’s a bug in the way WPSC behaves:
 * – When in Preload mode, when a post is published it gets cached indefinitely (
   unless updated).
 * – When that post is changed from “published” to “draft”, the cached version is
   NOT deleted. Therefore, the post remains public and accessible – even though 
   it no longer is.
 * – The only way of getting rid that post online, is to manually delete the cached
   page.
 * I tested this on a clean WordPress installation to verify this is indeed what
   happens regardless of my system.
 * Cheers,
 * Bira
 * [http://wordpress.org/extend/plugins/wp-super-cache/](http://wordpress.org/extend/plugins/wp-super-cache/)

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

 *  Thread Starter [Biranit](https://wordpress.org/support/users/biranit/)
 * (@biranit)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/published-to-draft-bug/#post-3703645)
 * FYI, I added a function to fix this:
 *     ```
       // delete posts cache when a post is unpublished
       function rgbtoi_post_unpublished( $new_status, $old_status, $post ) {
           if ( $old_status == 'publish' && $new_status != 'publish' ) {
               // Post is unpublished
               prune_super_cache ( get_supercache_dir() . '/' . $post->post_name . '/', true );
               // add here whatever other actions needed
           }
       }
       ```
   
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/published-to-draft-bug/#post-3703646)
 * Thanks for spotting that. I’m surprised that it occurs but I’ll add a similar
   fix to the plugin before the next release.
 *  Thread Starter [Biranit](https://wordpress.org/support/users/biranit/)
 * (@biranit)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/published-to-draft-bug/#post-3703649)
 * Thanks 🙂
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/published-to-draft-bug/#post-3703652)
 * As I said on another thread, I just checked in code that will fix this. Check
   out the development version in about 20 minutes!

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

The topic ‘Published-to-draft bug’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/published-to-draft-bug/#post-3703652)
 * Status: resolved