Title: wp cli cache
Published: December 19, 2018
Last modified: October 7, 2026

---

# 󠀁[wp cli cache <command>](https://developer.wordpress.org/cli/commands/cli/cache/)󠁿

Manages the internal WP-CLI cache.

## In this article

 * [Examples](https://developer.wordpress.org/cli/commands/cli/cache/?output_format=md#examples)
 * [Subcommands](https://developer.wordpress.org/cli/commands/cli/cache/?output_format=md#subcommands)

[ Back to top](https://developer.wordpress.org/cli/commands/cli/cache/?output_format=md#wp--skip-link--target)

 [ ⌊GitHub⌉ ](https://github.com/wp-cli/wp-cli)

 [ View Open Issues (0) ](https://github.com/login?return_to=%2Fissues%3Fq%3Dlabel%3Acommand%3Acli-cache+sort%3Aupdated-desc+org%3Awp-cli+is%3Aopen)
[ View Closed Issues (6) ](https://github.com/login?return_to=%2Fissues%3Fq%3Dlabel%3Acommand%3Acli-cache+sort%3Aupdated-desc+org%3Awp-cli+is%3Aclosed)
[Create New Issue](https://github.com/wp-cli/wp-cli/issues/new)

Unless overridden, these commands run on the `before_wp_load` hook, just before 
the WP load process begins.

### 󠀁[Examples](https://developer.wordpress.org/cli/commands/cli/cache/?output_format=md#examples)󠁿

    ```
    # Remove all cached files.
    $ wp cli cache clear
    Success: Cache cleared.

    # Remove all cached files except for the newest version of each one.
    $ wp cli cache prune
    Success: Cache pruned.
    ```

### 󠀁[Subcommands](https://developer.wordpress.org/cli/commands/cli/cache/?output_format=md#subcommands)󠁿

| Name | Description | 
| [wp cli cache clear](https://developer.wordpress.org/cli/commands/cli/cache/clear/) |

Clears the internal cache.

  | 
| [wp cli cache prune](https://developer.wordpress.org/cli/commands/cli/cache/prune/) |

Prunes the internal cache.

  |

 _Command documentation is regenerated at every release. To add or update an example,
please submit a pull request against the corresponding part of the codebase._