Title: Using ESI in shortcode
Last modified: November 11, 2025

---

# Using ESI in shortcode

 *  Resolved [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/using-esi-in-shortcode/)
 * Hi,
 * I want to exclude my contact form from caching and I’ve read in [this article](https://blog.litespeedtech.com/2018/12/12/wordpress-shortcodes-esi-blocks/)
   I can simply add `esi` + `ttl="0"` to the shortcode, if plugin does support it.
 * If I understand correctly I can make the plugin support this, by adding this 
   to the main plugin file:
 *     ```wp-block-code
       method_exists( 'LiteSpeed_Cache_API', 'purge' ) && LiteSpeed_Cache_API::purge( 'esi.my-shortcode' ) ;
       ```
   
 * Is this correct or should I do more, regarding the plugin?
 * Guido

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

 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/using-esi-in-shortcode/#post-18715197)
 * [@guido07111975](https://wordpress.org/support/users/guido07111975/) 
   ESI is 
   available only on LSC Enterprise versionDo you add the form using a shortcode?
 *  Thread Starter [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/using-esi-in-shortcode/#post-18715233)
 * > Do you add the form using a shortcode?
 * Yes, I do.
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/using-esi-in-shortcode/#post-18715346)
 * [@guido07111975](https://wordpress.org/support/users/guido07111975/) 
   Try this:
   If shortcode is `[form id="xx"]` change it to `[esi form id="xx"]`
 *  Thread Starter [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/using-esi-in-shortcode/#post-18715367)
 * And add this to the main plugin file, I guess?
 *     ```wp-block-code
       method_exists( 'LiteSpeed_Cache_API', 'purge' ) && LiteSpeed_Cache_API::purge( 'esi.my-shortcode' ) ;
       ```
   
 *  Plugin Support [litetim](https://wordpress.org/support/users/litetim/)
 * (@litetim)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/using-esi-in-shortcode/#post-18715378)
 * [@guido07111975](https://wordpress.org/support/users/guido07111975/) 
   Try without
   thatAlso the function do not exist in LSCJust make sure ESI is turned ON on server
   side

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

The topic ‘Using ESI in shortcode’ is closed to new replies.

 * ![](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

 * [esi](https://wordpress.org/support/topic-tag/esi/)

 * 5 replies
 * 2 participants
 * Last reply from: [litetim](https://wordpress.org/support/users/litetim/)
 * Last activity: [6 months, 3 weeks ago](https://wordpress.org/support/topic/using-esi-in-shortcode/#post-18715378)
 * Status: resolved