Kualo / docs
On this page

How to integrate Redis into WordPress

Connect Redis to WordPress using LiteSpeed Cache or W3 Total Cache to speed up page loads by caching database queries in memory.

3 min read Updated 9 Jun 2026

WordPress and Redis

Redis is an in-memory data store that can dramatically speed up your WordPress site by caching database query results. This article explains how it works and how to connect it to WordPress. It assumes you have already set up Redis in cPanel.

How caching works

The first time a WordPress page loads, the server runs a database query to build the page. Redis remembers that query result in memory. The next time any visitor loads the same page, Redis serves the result directly - no database query needed.

This implementation uses Redis as a persistent object cache with no expiration. Here is what that means in practice:

  • SQL query results are stored in memory, so pages load faster and the database handles less work.
  • If a query result is not yet cached, the database provides it and Redis stores it for next time.
  • If data changes in WordPress - for example, a new post is published - Redis invalidates the affected cached value so visitors never see stale content.

Redis vs. Memcached

Memcached is another popular caching option, but Redis is the better choice for most WordPress setups. Redis supports everything Memcached does, plus a much larger feature set - including data persistence, which means cached data survives a server restart.

Option 1: LiteSpeed Cache (recommended)

If you are using the LiteSpeed Cache plugin, configure Redis directly inside the plugin rather than installing a separate caching plugin.

  1. Log in to your WordPress Admin Dashboard.
  2. Go to LiteSpeed Cache > Settings > Cache > Object Cache.
  3. Enter your Redis hostname and port as shown in your cPanel Redis configuration.
  4. Save your changes.

LiteSpeed Cache object cache settings

Full details on LiteSpeed Cache object caching options are available in the LiteSpeed documentation.

Option 2: W3 Total Cache

If you are not using LiteSpeed Cache, W3 Total Cache is a solid alternative for connecting Redis to WordPress.

Install and activate W3 Total Cache

  1. Log in to your WordPress Admin Dashboard.
  2. Go to Plugins > Add New.
  3. Search for W3 Total Cache.
  4. Click Install Now, then Activate.

Once activated, W3 Total Cache appears as Performance in the main admin menu.

W3 Total Cache in the WordPress admin menu

Enable Redis for database and object cache

  1. Go to Performance > General Settings.
  2. Enable Database Cache and set the cache method to Redis.
  3. Enable Object Cache and set the cache method to Redis.
  4. Click Save all settings.

W3 Total Cache general settings showing Redis selected

If Redis does not appear as a cache method option, you have not yet set up Redis in cPanel.

Configure the database cache

  1. Go to Performance > Database Cache.
  2. Enter your Redis hostname or socket address exactly as it appears in cPanel.
  3. Enable Use persistent connection.
  4. Set a unique Redis Database ID for this cache type (for example, 1).
  5. If you use WooCommerce, add _wc_session_ to the Ignored query stems field.
  6. Save your settings.

Configure the object cache

  1. Go to Performance > Object Cache.
  2. Enter the same Redis hostname or socket address.
  3. Set a different unique Redis Database ID from the one used for the database cache (for example, 2).
  4. Save your settings.

If you need further help, contact the Kualo support team.

Was this helpful?
Your feedback helps us find gaps in the docs.
Still need a hand?
Real people, around the clock - start a chat or open a ticket and we'll help you put it right.