Title: Flush the object cache
Author: WordPress VIP Documentation
Published: June 19, 2023
Last modified: December 10, 2025

---

 1. [Caching](https://docs.wpvip.com/caching/)
 2. [Object cache](https://docs.wpvip.com/caching/object-cache/)
 3. Flush the object cache

#  Flush the object cache

The object cache can be flushed with [the WP-CLI command `wp cache flush`](https://developer.wordpress.org/cli/commands/cache/flush/).
WP-CLI commands must be [run with VIP-CLI](https://docs.wpvip.com/wp-cli-with-vip-cli/).

**Caution**

**Use caution when flushing the object cache on a production environment.** The 
performance of a site’s origin database server is protected by [the object cache layer](https://docs.wpvip.com/caching/object-cache/).
Flushing the object cache can have negative performance implications, particularly
during high traffic events.

**Prerequisites**

[VIP-CLI is installed](https://docs.wpvip.com/vip-cli/installing-vip-cli/) and has
been updated to [the most current version](https://www.npmjs.com/package/@automattic/vip/v/latest).

## Limitations

Group cache flush with the `[wp_cache_flush_group()](https://developer.wordpress.org/reference/functions/wp_cache_flush_group/)`
function or the [`wp cache flush-group`](https://developer.wordpress.org/cli/commands/cache/flush-group/)
WP-CLI command is not supported for WordPress environments on the VIP Platform.

## Command examples

#### VIP-CLI command examples

For demonstration purposes, the `<app-name>` value `example-app` and the `<env>`
value `production` are used in the VIP-CLI command examples below. Read more about
[how to target environments in VIP-CLI commands](https://docs.wpvip.com/vip-cli/target-environments/).

For WordPress single sites, the object cache can be flushed with the WP-CLI command`
wp cache flush`:

    ```lang-shell
    vip @example-app.production -- wp cache flush
    ```

For WordPress multisite environments, a specific network site must be targeted with
the `--url` parameter in order for `wp cache flush` to successfully flush the object
cache for that site.

    ```lang-shell
    vip @example-app.production -- wp cache flush --url=example.com
    ```

**Note**

When the WP-CLI command `wp cache flush` is run, a `Warning` message is returned
that reads: `Flushing the cache may affect all sites in a multisite installation`.
On VIP Platform environments, only the object cache for a network site that is targeted
with the `--url` option will be flushed. If `wp cache flush` is run against a multisite
environment without the `--url` parameter, only the object cache of the main site(
ID 1) will be flushed.

## Flushing the object cache after a domain change

On a WordPress multisite, to fully flush persistent objects from the object cache
multiple `wp cache flush` commands might need to be run.

For example, after a site launch or a domain change, the `wp cache flush` command
may need to be run for both the previous convenience domain value (e.g. `example-
app.go-vip.net`) and the launched custom domain value (e.g. `www.example.com`):

    ```lang-shell
    $ vip @example-app.production -- wp cache flush --url=example-app.go-vip.net
    Warning: Flushing the cache may affect all sites in a multisite installation, depending on the implementation of the object cache.
    Success: The cache was flushed.

    $ vip @example-app.production -- wp cache flush --url=www.example.com
    Warning: Flushing the cache may affect all sites in a multisite installation, depending on the implementation of the object cache.
    Success: The cache was flushed.
    ```

Last updated: December 10, 2025