Title: Programmatically purge cache from external API
Last modified: May 7, 2026

---

# Programmatically purge cache from external API

 *  [djwilko12](https://wordpress.org/support/users/djwilko12/)
 * (@djwilko12)
 * [14 hours, 22 minutes ago](https://wordpress.org/support/topic/programmatically-purge-cache-from-external-api/)
 * Hi LiteSpeed Cache team,
   I would like to know if there is an official or recommended
   way to purge LiteSpeed Cache programmatically from outside the WordPress admin
   panel.Use case: we have external automations/integrations that update content
   or trigger deployment-like changes, and we would like to clear/purge the cache
   without a human having to log in to wp-admin and click the purge button manually.
   Is there any supported option for this, such as:– a REST API endpoint,– a WP-
   CLI command that can be called remotely,– a PHP function/action/hook we can expose
   safely in a custom endpoint,– or another recommended integration method?Ideally,
   we would like to purge all cache or specific URLs/tags in a secure way from an
   external system.Thanks!

Viewing 1 replies (of 1 total)

 *  [Bob](https://wordpress.org/support/users/bobf000/)
 * (@bobf000)
 * [9 hours, 51 minutes ago](https://wordpress.org/support/topic/programmatically-purge-cache-from-external-api/#post-18902193)
 * [https://docs.litespeedtech.com/lscache/lscwp/api/](https://docs.litespeedtech.com/lscache/lscwp/api/)

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fprogrammatically-purge-cache-from-external-api%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

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

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [automation](https://wordpress.org/support/topic-tag/automation/)
 * [purge cache](https://wordpress.org/support/topic-tag/purge-cache/)
 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 1 reply
 * 2 participants
 * Last reply from: [Bob](https://wordpress.org/support/users/bobf000/)
 * Last activity: [9 hours, 51 minutes ago](https://wordpress.org/support/topic/programmatically-purge-cache-from-external-api/#post-18902193)
 * Status: not resolved