Title: [Plugin: WP Super Cache] wp_delete_post() &amp; wp_insert_post() Delete Entire Cache
Last modified: August 20, 2016

---

# [Plugin: WP Super Cache] wp_delete_post() & wp_insert_post() Delete Entire Cache

 *  [admintiger](https://wordpress.org/support/users/admintiger/)
 * (@admintiger)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-wp_delete_post-wp_insert_post-delete-entire-cache/)
 * I am developing a new website that currently has about 2500 pages with a custom
   post type. A few obsolete pages with that post type are automatically deleted
   and a few new ones are automatically created every ten minutes by a PHP CLI script
   that I wrote. Obsolete pages are deleted by calling wp_delete_post($postid, true).
   New pages are created by calling wp_insert_post($my_post). Calling either of 
   those functions deletes all existing supercache static files, but deleting or
   creating pages within the WP admin system does not.
 * Is there another way I can delete and create posts from my script that will prevent
   WP Super Cache from deleting the entire cache? If not, could my script set your
   DONOTDELETECACHE flag to avoid the problem? Is there another way if that isn’t
   going to work?
 * [http://wordpress.org/extend/plugins/wp-super-cache/](http://wordpress.org/extend/plugins/wp-super-cache/)

The topic ‘[Plugin: WP Super Cache] wp_delete_post() & wp_insert_post() Delete Entire
Cache’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [admintiger](https://wordpress.org/support/users/admintiger/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-wp_delete_post-wp_insert_post-delete-entire-cache/)
 * Status: not resolved