How to Configure Redis for WordPress

WordPress is the world's most popular content management system, powering over 40% of the web. However, as your website grows in traffic and complexity, you may notice performance issues-slower page load times, increased server resource usage, and degraded user experience.

One powerful solution is to configure Redis to serve as an object cache for WordPress. Redis dramatically improves performance by storing frequently used data in memory, reducing the need for repetitive database queries.

In this knowledgebase guide, Go4hosting explains step by step how to configure Redis for WordPress to supercharge your website.

What is Redis?

Redis (REmote DIctionary Server) is a high-performance, in-memory key-value store. It's commonly used for:

  • Object caching

  • Session storage

  • Queue management

  • Real-time analytics

When used with WordPress, Redis can cache:

  • Query results

  • API responses

  • Page fragments

  • Transients

  • Full object cache

Benefits:

  • Faster page load times
  • Reduced server load
  • Improved scalability
  • Enhanced user experience

At Go4hosting, many of our WordPress hosting, VPS, and dedicated server customers use Redis to optimize their sites for performance.

How Redis Helps WordPress

By default, WordPress stores most dynamic content in a MySQL database. Every time a page is loaded, it triggers multiple database queries:

  • Fetch posts

  • Load metadata

  • Check user sessions

  • Build menus

As traffic grows, this increases:

  • Database CPU usage

  • Latency

  • Page generation time

Redis acts as a fast memory-based cache:

  • WordPress stores frequently used objects in Redis.

  • On future page loads, WordPress retrieves objects from Redis instead of querying the database.

The result? Pages load much faster and with less strain on your server.

Prerequisites

Before you begin:

  • A WordPress website installed
  • Root or sudo access to your server (Go4hosting VPS, cloud server, or dedicated server)
  • WordPress supports Redis 100% compatible with:

  • Single site

  • Multisite

  • Popular caching plugins

Step 1: Install Redis on Your Server

For Ubuntu / Debian

  1. Update package list:

bash

CopyEdit

sudo apt update

  1. Install Redis server:

bash

CopyEdit

sudo apt install redis-server

  1. Enable and start Redis:

bash

CopyEdit

sudo systemctl enable redis

sudo systemctl start redis

  1. Check Redis status:

bash

CopyEdit

sudo systemctl status redis

You should see active (running).

For CentOS / RHEL / AlmaLinux / Rocky

  1. Install EPEL repository:

bash

CopyEdit

sudo yum install epel-release

  1. Install Redis:

bash

CopyEdit

sudo yum install redis

  1. Enable and start Redis:

bash

CopyEdit

sudo systemctl enable redis

sudo systemctl start redis

  1. Check Redis status:

bash

CopyEdit

sudo systemctl status redis

Step 2: Secure Redis

Basic security steps:

  • Bind Redis to localhost only (edit /etc/redis/redis.conf):

conf

CopyEdit

bind 127.0.0.1 ::1

  • Optionally set a password in redis.conf:

conf

CopyEdit

requirepass YOUR_PASSWORD


  • Restart Redis after changes:

bash

CopyEdit

sudo systemctl restart redis

Step 3: Install PHP Redis Extension

WordPress uses PHP to communicate with Redis. You need the PHP Redis extension.

For Ubuntu / Debian

bash

CopyEdit

sudo apt install php-redis

Restart web server:

bash

CopyEdit

sudo systemctl restart apache2

or (for Nginx + PHP-FPM):

bash

CopyEdit

sudo systemctl restart php-fpm

For CentOS / RHEL

bash

CopyEdit

sudo yum install php-redis

Then restart your web server.

Verify PHP Redis Extension

bash

CopyEdit

php -m | grep redis

You should see redis listed.

Step 4: Install a WordPress Redis Plugin

There are several Redis plugins available. Popular choices:

1. Redis Object Cache (Official plugin)

  • https://wordpress.org/plugins/redis-cache/

2. W3 Total Cache

  • Advanced caching plugin with Redis support.

3. LiteSpeed Cache

  • If using LiteSpeed Web Server, built-in Redis support.

For this guide, we'll use the Redis Object Cache plugin.

Install Redis Object Cache Plugin

  1. Log in to WordPress admin.

  2. Go to Plugins - Add New.

  3. Search for Redis Object Cache.

  4. Click Install, then Activate.

Step 5: Enable Redis Caching

After activating the Redis Object Cache plugin:

  1. Go to Settings - Redis (new menu item).

  2. Click Enable Object Cache.

The plugin will test the Redis connection. If everything is configured correctly, you'll see:

  • Connected
  • Object cache enabled

Optional: Add WP_CONFIG Tweaks

For advanced control, add the following lines to wp-config.php:

php

CopyEdit

define( 'WP_REDIS_HOST', '127.0.0.1' );

define( 'WP_REDIS_PORT', 6379 );

define( 'WP_REDIS_PASSWORD', 'YOUR_PASSWORD' ); // Only if password set

define( 'WP_CACHE_KEY_SALT', 'yoursiteprefix_' );

define( 'WP_REDIS_MAXTTL', 900 ); // Cache expiration in seconds

Step 6: Verify Redis Is Working

Check Redis Stats

bash

CopyEdit

redis-cli monitor

or

bash

CopyEdit

redis-cli info stats

You should see cache HITs and MISSes as you browse your website.

Check WordPress Plugin Dashboard

The Redis Object Cache plugin dashboard shows:

  • Current status

  • Number of keys cached

  • Cache hit ratio

Step 7: Optional Performance Enhancements

Combine Redis With Full Page Caching

For maximum performance:

  • Use Redis for object caching.

  • Use NGINX fastcgi_cache or WP Super Cache for full page caching.

  • Optimize your MySQL server settings.

Use Redis in Cluster Mode (Enterprise)

On large, high-traffic websites:

  • Run Redis in cluster mode.

  • Use Go4hosting�s managed Redis service for scalability and HA.

  • Store sessions and transients in Redis.

Troubleshooting

1. Plugin shows Redis not reachable

  • Check Redis is running: sudo systemctl status redis.

  • Verify PHP Redis extension is installed.

  • Check firewall settings (Redis should be bound to localhost).

2. Cache is not persistent across server restarts

  • Enable Redis persistence:

    • AOF (Append Only File) or RDB (snapshotting) in redis.conf.

3. High memory usage

  • Tune Redis maxmemory setting:

conf

CopyEdit

maxmemory 256mb

maxmemory-policy allkeys-lru

Benefits of Redis Caching on Go4hosting Servers

When you configure Redis for WordPress on a Go4hosting VPS, cloud server, or dedicated server, you get:

  • Up to 10x faster page loads
  • Reduced MySQL load
  • Improved server scalability
  • Better Google Core Web Vitals scores
  • Happier users

Go4hosting fully supports Redis on:

Our team can even pre-configure Redis for your server during setup.

Conclusion

Redis + WordPress = blazing fast websites.

To recap:

  • Install Redis server

  • Secure Redis

  • Install PHP Redis extension

  • Install Redis Object Cache plugin

  • Enable object caching

  • Optimize settings

With Redis, your WordPress site can handle:

  • More concurrent users

  • Faster response times

  • Lower server costs

At Go4hosting, we recommend Redis for all serious WordPress deployments.
Our experts can help you configure Redis optimally on your hosting plan.

Was this answer helpful? #0 #0
 

Did We Miss Out on Something?

Relax, we have you covered. At Go4hosting, we go the extra mile to keep our customers satisfied. We are always looking out for opportunities to offer our customers “extra” with every service. Contact our technical helpdesk and we’d be more than happy to assist you with your Cloud hosting, Colocation Server, VPS hosting, dedicated Server or reseller hosting setup. Get in touch with us and we’d cover all your hosting needs, however bizarre they might be.

Related Questions

Submit your Query

  • I'm not a robot

Browse by ServicesBrowse by Services

Resource Library

What is Cloud Computing

Understand the term cloud computing, the ongoing trend, its playing field, future growth and how industry...

Myths about Cloud Computing

Cloud computing, in the recent years, has become a subject of significant discussion among the industry experts.

Download Now

Did We Miss Out on Something?

Relax, we have you covered. At Go4hosting, we go the extra mile to keep our customers satisfied. We are always looking out for opportunities to offer our customers “extra” with every service. Contact our technical helpdesk and we’d be more than happy to assist you with your Cloud hosting, Colocation Server, VPS hosting, dedicated Server or reseller hosting setup. Get in touch with us and we’d cover all your hosting needs, however bizarre they might be.

Submit Query

Please fill in the form below and we will contact you within 24 hours.