Redis object cache for WordPress: speed up queries
Redis caches WordPress database query results in memory, dramatically reducing load times for sites with high database activity.
On this page
Redis is an in-memory data store. When configured as a WordPress object cache, it stores the results of database queries in RAM. Subsequent requests for the same data are served from memory instead of re-querying MySQL-orders of magnitude faster.
What is WordPress object cache?
WordPress has a built-in object cache that stores data in memory during a single request. By default, this cache is cleared at the end of each request. Redis provides a persistent object cache-data stored in Redis survives across requests, so the next visitor gets pre-cached query results without hitting the database.
This is especially useful for:
- WooCommerce stores with many products and orders
- WordPress multisite installations
- High-traffic blogs with complex queries
- Sites using heavy plugins that query the database frequently
UnderHost shared hosting includes Redis Manager in cPanel. On VPS and dedicated servers, Redis can also be installed as a service directly on the server. Use the path that matches your plan.
When to use it
If your WordPress site already has page caching enabled but is still slow due to database load, Redis object cache is the next logical step. Page caching eliminates PHP execution for static pages; object cache speeds up the PHP execution that page caching can't eliminate (admin pages, AJAX, WooCommerce cart, search).
Install Redis on your server
If you are on VPS or dedicated hosting, SSH into your server and install Redis:
# Ubuntu / Debian
apt install redis-server -y
systemctl enable redis-server
systemctl start redis-server
# AlmaLinux / CentOS
dnf install redis -y
systemctl enable redis
systemctl start redis
Verify Redis is running:
redis-cli ping
You should see: PONG
By default, Redis only listens on 127.0.0.1:6379-accessible only from the same server. This is the correct, secure configuration for WordPress use.
Configure WordPress to use Redis
Install the Redis Object Cache plugin:
- WordPress Admin → Plugins → Add New → search "Redis Object Cache" → Install and Activate
- Go to Settings → Redis
- Click Enable Object Cache
- The status should change to "Connected" and "Enabled"
Optionally add connection settings to wp-config.php if using a non-default port or socket:
define( 'WP_REDIS_HOST', '127.0.0.1' );
define( 'WP_REDIS_PORT', 6379 );
Verify Redis is working
In WordPress Admin → Settings → Redis, the diagnostics panel shows connection status, hit rate, and memory usage. A high cache hit rate (above 80%) confirms Redis is working effectively.
You can also monitor Redis activity from the command line:
# Real-time Redis command monitor
redis-cli monitor
# Memory and stats
redis-cli info stats | grep keyspace_hits
Need managed WordPress hosting?
Run WordPress on UnderHost managed hosting with performance tuning, SSL, backups, security guidance, and expert support.





















