WP Super Cache
[resolved] Published-to-draft bug (5 posts)

  1. Biranit
    Posted 3 years ago #

    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.




  2. Biranit
    Posted 3 years ago #

    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
  3. Donncha O Caoimh
    Plugin Author

    Posted 3 years ago #

    Thanks for spotting that. I'm surprised that it occurs but I'll add a similar fix to the plugin before the next release.

  4. Biranit
    Posted 3 years ago #

    Thanks :)

  5. Donncha O Caoimh
    Plugin Author

    Posted 2 years ago #

    As I said on another thread, I just checked in code that will fix this. Check out the development version in about 20 minutes!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.