WP CLI

Redis Cache Pro supports several WP CLI commands.

Enabling & disabling the dropin

To copy and enable the object cache use the wp redis enable command.

This command will fail if a object-cache.php already exists, to overwrite any existing dropin use the --force argument.

wp redis enable --force

To disable the object cache, run:

wp redis disable

Flushing the cache

Use the wp cache flush command to flush the entire object cache.

CAREFUL! This will flush any data stored in Redis. To avoid accidental data loss, use a separate database for your object cache.

Asynchronous flushing

To asynchronously flush the object cache, use the --async argument:

wp cache flush --async

Retrieve cache information

To show the object cache status and diagnostic information use:

wp redis info