# Purge LiteSpeed Cache After Design Changes

> Purges the whole LiteSpeed Cache when the Customizer, menus or widgets are saved, so header, footer and sidebar changes appear on every page right away.

- Type: PHP
- Runs: Run everywhere
- Category: [Plugin Integrations](https://wpide.com/library/category/integrations/)
- Tags: litespeed, cache, customizer
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/litespeed-purge-on-settings-change/

## Code

```php
$wpide_purge = function () {
    if ( defined( 'LSCWP_V' ) ) {
        do_action( 'litespeed_purge_all' );
    }
};

add_action( 'customize_save_after', $wpide_purge );
add_action( 'wp_update_nav_menu', $wpide_purge );
add_action( 'update_option_sidebars_widgets', $wpide_purge );
```

## Notes

""

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Purge LiteSpeed Cache After Design Changes" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
