If your WordPress dashboard crawls, your WooCommerce shop slows down during a sale, or Site Health keeps nagging you with “You should use a persistent object cache”, the fix is usually the same: connect WordPress to Redis. A WordPress Redis cache keeps the results of repeated database queries in memory, so PHP stops asking MySQL the same questions on every request.
This guide walks through the whole WordPress Redis object cache setup from a bare server to a verified, monitored, secured install. You will install Redis, add the PhpRedis extension, activate the Redis Object Cache WordPress plugin, configure it through wp-admin or wp-config.php, and learn what to do when the status says “not connected”. We also cover multiple sites on one Redis instance, LiteSpeed and shared hosting quirks, and the security mistakes that leave Redis open to the internet.
Quick answer: (1) Install Redis on your server. (2) Install the PHP Redis extension. (3) Install and activate the free Redis Object Cache plugin. (4) Add connection constants to
wp-config.phpif Redis is not on127.0.0.1:6379. (5) Go to Settings → Redis and click Enable Object Cache. The status should read “Connected”.
1. What Is Redis Object Cache in WordPress?
WordPress ships with an internal object cache (the WP_Object_Cache class). Every time core, your theme or a plugin calls functions such as get_option(), get_post_meta() or wp_cache_get(), WordPress first checks that cache before it queries the database. The catch is that by default this cache lives only for the duration of a single request. When the page finishes loading, everything is thrown away, and the next visitor starts from zero.
A persistent object cache fixes that by storing the cached data in an external memory store that survives between requests. Redis is the most popular choice. It is an in-memory key-value data store, so reading a cached value takes a fraction of the time a MySQL query needs. The free Redis Object Cache plugin by Till Krüss is the connector: it installs a small drop-in file called object-cache.php into wp-content that swaps WordPress’s throw-away cache for Redis.
Put simply, WordPress object cache using Redis turns “ask the database every time” into “ask the database once, remember the answer”. The plugin is actively maintained (version 3.0.2 at the time of writing), supports PhpRedis, Predis and Relay clients, and has more than 500,000 active installations according to its WordPress.org listing.
2. How Does Redis Object Caching Work?
Redis object caching works as a lookup table in RAM. Every cached item has a key (for example options:alloptions), a group (such as posts or terms) and a value. The flow on each request looks like this:
- WordPress needs a piece of data, say the site’s active plugins list.
- The
object-cache.phpdrop-in asks Redis for that key. - Cache hit: Redis returns the value from memory and the database query is skipped.
- Cache miss: WordPress runs the SQL query, then saves the result in Redis so the next request gets a hit.
- When content changes (you update a post, an order is placed), WordPress deletes or replaces the affected keys, so visitors do not see stale data.
Here is the pattern developers use in their own code. Any plugin that follows it benefits automatically once Redis is connected:
function athemeart_get_featured_count() {
$count = wp_cache_get( 'featured_count', 'athemeart' );
if ( false === $count ) {
global $wpdb;
$count = (int) $wpdb->get_var(
"SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_key = '_featured' AND meta_value = 'yes'"
);
wp_cache_set( 'featured_count', $count, 'athemeart', HOUR_IN_SECONDS );
}
return $count;
}
Without Redis, that cached count disappears at the end of the request. With Redis, it survives for the full hour. The same applies to transients: when a persistent object cache is active, WordPress stores transients in Redis rather than in the wp_options table, which keeps the options table lean and fast.
3. Redis Object Cache vs Page Cache vs Browser Cache
These caches do different jobs and work best together. Page caching serves a finished HTML file. Browser caching keeps static files on the visitor’s device. Object caching speeds up the building of every page that cannot be served from a static file, which includes the admin area, carts, checkouts and logged-in views.
| Cache type | What it stores | Where it lives | Helps logged-in users? | Typical tool |
|---|---|---|---|---|
| Browser cache | Images, CSS, JS, fonts | Visitor’s device | Yes (static files only) | Cache-Control headers |
| Page cache | Complete HTML pages | Disk, server or CDN edge | No (usually bypassed) | Server cache, caching plugins |
| OPcache | Compiled PHP bytecode | Server memory | Yes | PHP built-in |
| Object cache (Redis) | Database query results and WordPress objects | Redis (RAM) | Yes | Redis Object Cache plugin |
So you do not choose between them. If you already run a full-page solution, our WP Rocket review shows how a page cache plugin behaves, and Redis simply sits underneath it to make every uncached request cheaper.
4. Benefits of Using Redis Object Cache in WordPress
- Lower database load. Repeated reads (options, post meta, taxonomy terms, user data) come from memory instead of MySQL, so the database has headroom during traffic spikes.
- A faster wp-admin. The dashboard, post editor, plugin screens and WooCommerce order lists are dynamic and cannot be page cached. This is where Redis feels most dramatic.
- Better dynamic sites. Membership sites, LMS platforms, forums and stores gain the most because personalised pages bypass page caching.
- Faster transients. Plugins that cache API responses or feeds in transients stop bloating
wp_options. - Better scaling per server. The same hardware can serve more concurrent users before you need a bigger plan.
- Cleaner Site Health. WordPress 6.1 and later add a Site Health check that recommends a persistent object cache on larger sites. Once Redis is connected, that notice goes away. You can read how the check works in the WordPress Core announcement and the official optimization handbook.
WooCommerce stores are the textbook case. Product lookups, term counts, attribute data and stock meta get requested again and again, and cart, checkout and account pages must stay out of page caches. If your shop is sluggish, pair Redis with the fixes in our guide to speeding up a WooCommerce store. Redis will not fix an oversized image library or a slow theme, but it removes one of the biggest repeating costs.
Redis helps most when:
- You run WooCommerce, memberships or LMS
- wp-admin feels slow
- Many plugins query post meta
- You see traffic spikes
Redis helps less when:
- You run a small static brochure site
- Pages are already fully cached and rarely change
- The bottleneck is images, scripts or the theme
- Your host cannot provide Redis
5. Requirements Before Installing Redis
Before you start, confirm the following. Skipping this check is the number one reason people end up with a “not connected” status later.
- Server access. You need root or sudo (VPS, cloud server, dedicated server) or a host that already offers Redis in its control panel.
- PHP 7.2 or higher. That is the plugin’s minimum. In practice run a currently supported PHP 8.x release.
- WordPress 4.6 or higher. The current plugin release lists compatibility with very recent WordPress versions.
- The PhpRedis extension (recommended) or the bundled Predis library as a fallback.
- Enough RAM. Start with 128 to 256 MB reserved for Redis on a typical single site and watch usage afterwards.
- A backup. Back up files and the database. The plugin writes a file into
wp-content, and you will editwp-config.php. - No competing object cache. Disable object caching in other caching plugins (W3 Total Cache, LiteSpeed Cache, and similar) so two drop-ins do not fight over
object-cache.php.
One more note: Redis is not the only compatible server. Valkey, the open-source fork backed by the Linux Foundation, speaks the same protocol, and several cloud providers document using the Redis Object Cache plugin with Valkey databases. Everything below applies to both.
6. How to Install Redis on Your Server
Connect over SSH first. The commands below assume a fresh VPS where WordPress is already installed.
Ubuntu / Debian
The quickest route is the distribution package:
sudo apt update
sudo apt install redis-server -y
sudo systemctl enable --now redis-server
Distribution packages can lag behind. If you want the newest stable release, use the official Redis APT repository, as described in the Redis installation documentation:
sudo apt-get install lsb-release curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis
CentOS / RHEL (Rocky Linux and AlmaLinux)
sudo dnf install redis -y
sudo systemctl enable --now redis
On EPEL or older CentOS systems you may need sudo yum install epel-release first. Be aware that some newer enterprise releases ship Valkey in place of Redis. The package name can change, but the service speaks the same protocol, so the WordPress side stays identical.
Tune the Redis configuration for WordPress
Open the config file (/etc/redis/redis.conf on most systems) and review these lines. They make Redis behave like a cache instead of a database:
# Listen only on the local machine
bind 127.0.0.1 -::1
protected-mode yes
port 6379
# Cap memory and evict the least recently used keys when full
maxmemory 256mb
maxmemory-policy allkeys-lru
# Require a password (generate one with: openssl rand -base64 32)
requirepass "replace-with-a-long-random-password"
Why allkeys-lru? WordPress writes many keys without an expiry time. The volatile-lru policy only evicts keys that have a TTL, so a cache full of non-expiring keys would start returning out-of-memory errors. With allkeys-lru, Redis simply drops the coldest entries and keeps working. Since the cache can always be rebuilt from MySQL, losing keys is harmless. For the same reason, disk persistence (appendonly, save rules) is optional for a pure cache. Leave the defaults unless you also use this Redis instance for something that must survive a reboot.
Restart the service after editing:
sudo systemctl restart redis-server # use "redis" on RHEL-based systems
Verify the Redis installation
redis-server --version
redis-cli -a 'replace-with-a-long-random-password' ping
# Expected output: PONG
sudo systemctl status redis-server --no-pager
Seeing PONG means Redis is running and accepting authenticated connections on localhost.
7. How to Install and Enable the Redis PHP Extension
WordPress is written in PHP, so PHP needs a client library to talk to Redis. The recommended one is PhpRedis, a C extension that is faster than pure-PHP clients. The plugin can fall back to Predis, which it bundles, but PhpRedis is the better choice for production.
Install the PHP Redis extension
On Ubuntu or Debian:
php -v # note your PHP version, e.g. 8.3
sudo apt install php-redis -y
sudo systemctl restart php8.3-fpm # match your version
On RHEL-family systems with the Remi repository:
sudo dnf install php-pecl-redis6 -y
sudo systemctl restart php-fpm
If your distribution has no package, sudo pecl install redis followed by adding extension=redis.so to a PHP ini file works too. On OpenLiteSpeed or LiteSpeed servers, install the matching lsphp package (for example lsphp83-redis) because LSAPI uses its own PHP binaries.
Verify the PHP Redis extension
php -m | grep -i redis
php --ri redis
Careful: the command line PHP and the PHP that serves your website are often different builds. The check that matters is the web one. After enabling the plugin, the Diagnostics tab will show Client: PhpRedis if the web PHP can see the extension. You can also run this tiny test script from the CLI to confirm Redis answers PHP calls (delete it afterwards):
<?php
$redis = new Redis();
$redis->connect( '127.0.0.1', 6379 );
$redis->auth( 'replace-with-a-long-random-password' );
echo $redis->ping(); // returns 1 (or +PONG depending on version)
8. How to Install the Redis Object Cache Plugin in WordPress
With Redis and PhpRedis ready, install the connector plugin:
- Log in to wp-admin and open Plugins → Add New Plugin.
- Search for Redis Object Cache by Till Krüss.
- Click Install Now, then Activate.
Prefer the command line? WP-CLI does the same in one line, and gives you the wp redis commands used later in this guide:
wp plugin install redis-cache --activate
Activating the plugin does not turn caching on yet. It only adds the settings screen. WordPress keeps using its default non-persistent cache until you enable the drop-in in the next steps.
9. How to Configure Redis Object Cache in WordPress
By default the plugin connects to Redis over TCP at 127.0.0.1 on port 6379 and uses database 0. If that matches your server and Redis has no password, you can skip straight to enabling the cache. Otherwise configure the connection in wp-config.php. The plugin does not store connection details in the admin screen: wp-admin shows them, but the values come from constants.
Configure Redis through WP Admin
Open Settings → Redis (on multisite: Network Admin → Settings → Redis). The Overview tab shows the status, the filesystem state, whether Redis is reachable and whether the drop-in is valid. The Metrics tab charts response time, memory and hit ratio, and Diagnostics lists every connection parameter the plugin detected. Think of the WordPress Redis object cache wp-admin screen as a read-only dashboard plus the Enable, Disable and Flush buttons.
Configure Redis using wp-config.php
Add the constants you need above the line that says /* That's all, stop editing! Happy publishing. */. Here is a typical secure setup for Redis on the same server:
define( 'WP_REDIS_HOST', '127.0.0.1' );
define( 'WP_REDIS_PORT', 6379 );
define( 'WP_REDIS_PASSWORD', 'replace-with-a-long-random-password' );
define( 'WP_REDIS_DATABASE', 0 );
define( 'WP_REDIS_PREFIX', 'shop_' );
define( 'WP_REDIS_TIMEOUT', 1 );
define( 'WP_REDIS_READ_TIMEOUT', 1 );
define( 'WP_REDIS_CLIENT', 'phpredis' );
Configure Redis host, port, password, and database
| Constant | Default | What it does |
|---|---|---|
WP_REDIS_HOST |
127.0.0.1 | Hostname or IP of the Redis server (ignored for UNIX sockets) |
WP_REDIS_PORT |
6379 | TCP port |
WP_REDIS_PASSWORD |
none | Password; also accepts an array ['user','password'] for Redis ACL logins |
WP_REDIS_DATABASE |
0 | Logical database number, 0 to 15 on a default install |
WP_REDIS_PREFIX |
none | Prefix on every key; keeps sites from colliding |
WP_REDIS_SCHEME |
tcp | tcp, unix or tls for encrypted remote connections |
WP_REDIS_PATH |
none | Path to the socket file when using unix |
WP_REDIS_CLIENT |
auto | phpredis, predis or relay; defaults to PhpRedis when installed |
WP_REDIS_MAXTTL |
0 | Maximum lifetime of keys in seconds (0 means no forced expiry) |
WP_REDIS_IGNORED_GROUPS |
[] | Cache groups that should not be stored in Redis |
WP_REDIS_DISABLED |
false | Emergency switch that bypasses Redis without deleting the drop-in |
You can find the complete list in the plugin’s GitHub repository.
Optional: connect through a UNIX socket
When WordPress and Redis share a server, a socket avoids the TCP layer and is a little faster. Edit redis.conf:
unixsocket /run/redis/redis-server.sock
unixsocketperm 770
sudo usermod -aG redis www-data # your PHP-FPM user may differ
sudo systemctl restart redis-server php8.3-fpm
define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/run/redis/redis-server.sock' );
define( 'WP_REDIS_PASSWORD', 'replace-with-a-long-random-password' );
10. How to Enable Redis Object Cache
Once the connection constants are in place, enabling takes seconds.
From wp-admin: go to Settings → Redis and click Enable Object Cache. The plugin copies object-cache.php into wp-content and connects to Redis. The button changes to “Disable Object Cache” and the status turns to “Connected”. Recent versions refuse to enable the cache when Redis is unreachable, which prevents you from locking yourself out.
From WP-CLI:
wp redis enable
wp redis status
If the button is missing or the plugin says the filesystem is not writable, check ownership of wp-content or copy the file by hand:
cp wp-content/plugins/redis-cache/includes/object-cache.php wp-content/object-cache.php
11. How to Verify Redis Object Cache Is Working
“Connected” is a good sign, but verify with real data. Use at least two of these checks.
Check 1: the Diagnostics tab
Open Settings → Redis → Diagnostics. You want the client to be PhpRedis, the drop-in valid, no errors, and the host, port and database to match what you configured.
Check 2: WP-CLI
wp redis status
wp cache type # should mention a persistent / Redis implementation
Check 3: prove values persist between requests
This is the cleanest test of persistence. Run each command as a separate process:
wp eval 'wp_cache_set( "redis_test", "hello", "demo", 300 ); echo "stored";'
wp eval 'echo wp_cache_get( "redis_test", "demo" );'
If the second command prints hello, the value survived a full PHP shutdown, which the default non-persistent cache can never do.
Check 4: ask Redis directly
redis-cli -a 'your-password' --no-auth-warning DBSIZE
redis-cli -a 'your-password' --no-auth-warning --scan --pattern 'shop_*' | head
redis-cli -a 'your-password' --no-auth-warning INFO stats | grep -E 'keyspace_(hits|misses)'
Browse your site, reload the command, and watch DBSIZE and keyspace_hits climb. Your hit ratio equals hits divided by hits plus misses.
Check 5: Site Health and Query Monitor
Open Tools → Site Health. The recommendation “You should use a persistent object cache” should disappear. For a request-level view, install Query Monitor, which reports object cache hits and misses per page and shows whether the cache is persistent.
12. How to Configure Redis Object Cache on Different Hosting Environments
Redis runs as its own service, independent of your web server, so the setup is nearly identical everywhere. What changes is who controls PHP, who owns the Redis process and which file you have to restart.
Nginx
Nginx hands PHP requests to PHP-FPM, so the PhpRedis extension must be enabled for the FPM version your site uses. After installing it, restart php-fpm (not only Nginx). Nginx FastCGI caching is a page cache and coexists with Redis. If you are weighing web servers, see our comparison of Nginx vs LiteSpeed.
Apache
With PHP-FPM behind Apache, treat it exactly like Nginx. With legacy mod_php, restart Apache itself after installing the extension: sudo systemctl restart apache2 (or httpd). Do not let an .htaccess page-cache rule cache wp-admin or WooCommerce account pages.
LiteSpeed and OpenLiteSpeed
LiteSpeed Cache for WordPress has its own Object Cache tab that can connect to Redis or Memcached. Use either that tab or the Redis Object Cache plugin, never both. Two plugins fighting over object-cache.php is a classic cause of broken status screens. Install the Redis extension for the lsphp binary your virtual host uses.
Shared hosting
On true shared hosting you cannot install Redis, because that needs root access. Your options are to ask the host whether Redis is available in the control panel (many now offer it per account, often through a socket path they give you), upgrade to a plan that includes it, or move hosts. Our comparison of managed WordPress hosting vs shared hosting explains what you get at each tier. If your host provides a per-account socket or unusual port, copy those values into WP_REDIS_PATH or WP_REDIS_PORT.
Managed hosts often sell Redis as an add-on. At the time of writing, Raidboxes lists its Redis add-on from €3 per month (net) on Starter and €10 on Pro boxes, while Kinsta’s article quotes $100 per month per site. Prices vary and change, so check current pricing and ask whether their integration uses the same plugin so you can still manage it from wp-admin.
VPS and dedicated servers
You have full control, so follow sections 6 to 9 as written. Practical tips: give Redis a fixed maxmemory so it cannot starve PHP and MySQL, keep it bound to localhost, and enable systemctl enable so it starts on boot. Container users can run Redis in a separate container on the same Docker network and set WP_REDIS_HOST to the service name.
13. How to Configure Redis for Multiple WordPress Websites
One Redis server can serve many WordPress sites, but you must stop their keys from colliding. Otherwise Site A may read Site B’s options, and flushing one site wipes all the others. Use two layers of isolation:
- A unique
WP_REDIS_PREFIXper site. Make it short and readable, such asblog_orshop_. - A separate
WP_REDIS_DATABASEnumber per site (0 to 15 by default). The plugin’s own configuration notes say that when you use the Relay client, each installation must have a dedicated database and a unique prefix.
Example for the second site:
define( 'WP_REDIS_DATABASE', 1 );
define( 'WP_REDIS_PREFIX', 'shop_' );
define( 'WP_REDIS_SELECTIVE_FLUSH', true ); // only delete this site's keys when flushing
If you need stronger separation, for example a client site that must never share memory with another, run a separate Redis instance per site on its own port (say 6380, 6381) with its own maxmemory, and point WP_REDIS_PORT at it. Redis 6 and later also supports ACL users restricted to key patterns, which is worth exploring for hosting providers. For a WordPress multisite network, network activate the plugin and enable the cache once from the Network Admin screen. Multisite handles per-blog key prefixes for you.
14. How to Monitor Redis Object Cache Performance
An object cache you never look at will eventually fill up, evict hot keys or quietly stop connecting. Check these signals regularly.
- Hit ratio. A healthy site is mostly hits. Expect a low ratio right after enabling or flushing, because the cache is cold. If it stays low for days, the cache may be too small or something is flushing it constantly.
- Memory use against
maxmemory. If Redis sits at the limit andevicted_keyskeeps rising, raisemaxmemoryor reduce what is cached. - Response time. The admin bar node and the dashboard widget show recent Redis response times. Spikes can point to network latency (a remote Redis server) or very large cached values.
- Connection count and slow commands. Useful on busy servers.
redis-cli INFO stats | grep -E 'keyspace_hits|keyspace_misses|evicted_keys'
redis-cli INFO memory | grep -E 'used_memory_human|maxmemory_human'
redis-cli INFO clients | grep connected_clients
redis-cli --latency
redis-cli SLOWLOG GET 10
Add -a 'password' to each command if you set requirepass. For a visual alternative to the terminal, Redis ships a free GUI called Redis Insight. To switch off the metrics collection on a very busy site, define WP_REDIS_DISABLE_METRICS as true.
15. How to Clear or Flush Redis Cache in WordPress
Flushing deletes cached keys so WordPress rebuilds them from the database. Do it when you see stale data after a migration, a direct database edit or a settings change that does not seem to apply. Do not make it a daily habit: right after a flush every request is a miss and your database takes the hit.
- Plugin screen: Settings → Redis → Flush Cache.
- Admin bar: the Object Cache node offers a flush action from any wp-admin page.
- WP-CLI:
wp cache flushorwp redis flushdepending on your version. - Redis directly:
redis-cli -n 1 FLUSHDBwipes database number 1 only. AvoidFLUSHALLon a shared server because it deletes every site’s cache.
Be aware that, without a selective flush, a plugin-level flush clears the whole Redis database number the site uses, including anything else stored there. That is another reason to give every site its own database and prefix, and to set WP_REDIS_SELECTIVE_FLUSH if a database has to be shared.
16. Common Redis Object Cache Problems and How to Fix Them
Most failures fall into a handful of buckets. Start with the flowchart, then use the table for the exact error text.
Redis Object Cache WordPress “not connected”
This is the most searched problem, and the cause is almost always one of the four boxes above. Run these checks in order:
sudo systemctl status redis-server --no-pager
redis-cli ping
ss -ltnp | grep 6379
sudo tail -n 50 /var/log/redis/redis-server.log
php -m | grep -i redis
On RHEL-family systems with SELinux enforcing, PHP may be blocked from opening network connections. The standard fix is:
sudo setsebool -P httpd_can_network_connect 1
Error and fix reference
| Symptom or error | Likely cause | Fix |
|---|---|---|
| Status: Not connected / Connection refused | Redis stopped, wrong host or port | Start Redis, verify WP_REDIS_HOST and WP_REDIS_PORT |
NOAUTH Authentication required |
Redis has a password, WordPress has none | Add WP_REDIS_PASSWORD |
WRONGPASS invalid username-password pair |
Wrong password or ACL username | Correct the password; add WP_REDIS_USERNAME if you use ACLs |
| Client shows Predis, not PhpRedis | Extension missing in the web PHP | Install the PHP extension, restart PHP-FPM |
| Drop-in invalid / foreign drop-in | Another plugin wrote object-cache.php |
Disable the other object cache, then re-enable from the Redis screen |
| Filesystem not writable | Permissions or DISALLOW_FILE_MODS |
Fix ownership of wp-content or copy the drop-in manually |
OOM command not allowed |
maxmemory reached with noeviction policy |
Set maxmemory-policy allkeys-lru or raise memory |
| Site shows a Redis error page or white screen | Redis went down while the drop-in is active | Restore Redis, or rename wp-content/object-cache.php, or set WP_REDIS_DISABLED to true |
| Old values keep appearing | Stale keys, shared prefix, or a plugin writing directly to the database | Flush the cache, use unique prefixes, check selective flush settings |
| Hit ratio stays low | Cache too small or constantly flushed | Increase maxmemory; find plugins or cron jobs that flush the cache |
Emergency recovery. If the front end breaks after enabling Redis and you cannot reach wp-admin, you do not need to reinstall anything. Rename the drop-in or disable the cache with the constant. WordPress falls back to its default cache immediately:
mv wp-content/object-cache.php wp-content/object-cache.php.off
# or add this to wp-config.php:
# define( 'WP_REDIS_DISABLED', true );
17. Redis Object Cache Security Best Practices
An exposed Redis server is a serious vulnerability, and scanners hunt for open port 6379 around the clock. Treat Redis as an internal service.
- Bind to localhost. Keep
bind 127.0.0.1 -::1andprotected-mode yesunless you truly need remote access. - Block port 6379 at the firewall. With UFW:
sudo ufw deny 6379. In cloud consoles, never open 6379 to0.0.0.0/0. - Require authentication. Use
requirepassat minimum, or ACL users on Redis 6+. The Redis ACL documentation explains how to restrict dangerous commands per user. - Encrypt remote connections. If Redis must live on another host, use TLS (
WP_REDIS_SCHEMEset totls) or a private network or VPN, and allow only the web server’s IP. - Protect
wp-config.php. It now holds a password. Keep permissions tight (for example 640), never commit it to a public repository and keep it out of backups you share. - Use unique prefixes and databases per site so one compromised site cannot read another’s cache keys easily.
- Do not store secrets you cannot lose in the cache. It is a cache: assume any key can disappear.
- Keep everything updated. Redis, PHP, the extension and the plugin all receive security fixes. Pair this with the habits in a good WordPress security checklist.
18. Frequently Asked Questions
Is the Redis Object Cache plugin free?
Yes. The plugin by Till Krüss is free and open source. A paid product, Object Cache Pro, is a separate commercial alternative with extra features such as compression, prefetching and analytics. You do not need it for a standard setup.
Do I need Redis if I already use a page caching plugin?
Probably yes for dynamic sites. Page caching serves logged-out visitors, while Redis speeds up everything that is generated by PHP: wp-admin, carts, checkouts, search and logged-in views. They complement each other.
Why does the plugin say “not connected” even though Redis is running?
Usually the web PHP cannot reach Redis. Check that the PHP extension is loaded in the FPM or LiteSpeed PHP version your site uses, that the host, port and password in wp-config.php match the server, and that SELinux or a firewall is not blocking the connection. Work through the troubleshooting section above.
Can I use Redis object cache on shared hosting?
Only if your host offers it. You cannot install Redis without root access. Ask support whether Redis is available on your plan and what connection details (host, port or socket path) to use.
Redis or Memcached for WordPress?
Both work, but Redis is the more common choice. It supports richer data structures, optional persistence to disk and a larger ecosystem of WordPress tooling, including the plugin covered here. Choose Memcached only if your host provides it and nothing else.
Will Redis speed up my WooCommerce store?
It reduces database load for product, term and meta lookups and makes the admin and checkout flow more responsive, especially under concurrent traffic. It is one part of a full optimization plan alongside hosting, images and theme choice.
Is it safe to flush the Redis cache?
Yes. The cache is rebuilt from the database. Expect a short slowdown while it warms up, so avoid flushing during peak traffic.
How much memory should I give Redis?
Start with 128 to 256 MB for a single typical site and monitor used_memory and evicted_keys. Large WooCommerce stores or many sites on one instance may need more. If evictions grow steadily, increase maxmemory.
What does “WordPress Redis object cache instance” mean?
An instance is one running Redis server process (one port, one config, one memory limit). You can serve many sites from a single instance by using separate databases and prefixes, or run one instance per site for stronger isolation.
Can I use Valkey instead of Redis?
Generally yes. Valkey is protocol-compatible, and the same plugin and wp-config.php constants are used. Confirm your host’s documentation and test with wp redis status after connecting.
19. Final Thoughts
Redis object caching is one of the highest-impact upgrades you can make to a dynamic WordPress site, and the setup is far less scary than it looks. Install Redis, add the PhpRedis extension, activate the Redis Object Cache plugin, add your connection details, click Enable Object Cache, then verify with Diagnostics, WP-CLI and a real hit ratio. Give each site its own prefix and database, keep Redis bound to localhost behind a password, and watch memory and evictions every so often.
Do those things and you get a snappier dashboard, a calmer database and a store that holds up when traffic spikes. If your host cannot provide Redis, that alone is a good reason to move to one that can.

