How to set up a Redis Cache plugin for WordPress CMS?

On this page
  1. Step 1: Obtain the Redis Socket Path
  2. Step 2: Install the Redis Object Cache Plugin
  3. Step 3: Edit the wp-config.php File
  4. Step 4: Add Redis Configuration
  5. Step 5: Verify the Connection
  6. Step 6: Enable Object Cache
  7. Troubleshooting
  8. Plugin Cannot Connect to Redis
  9. Redis Status Shows Disconnected
  10. Website Displays Errors After Editing wp-config.php
  11. Benefits of Redis Object Cache
  12. Summary

If you prefer not to use the LiteSpeed Cache plugin included with WordPress installations on mybox, but still want to take advantage of Redis object caching, you can use the Redis Object Cache plugin available from the official WordPress plugin repository.

Redis object caching can significantly improve website performance by storing frequently accessed database queries in memory, reducing the number of database requests generated by WordPress.

If you don’t know what Redis is, the following list will help you get familiar with this technology:
– What is Redis?
– How do I activate the Redis server?

Before You Begin

Before configuring the plugin, make sure that:

  • A Redis server is active for your hosting account.
  • You have access to your WordPress administration panel.
  • You have FTP access to your hosting account.

If Redis has not yet been enabled, activate it first from the mybox Panel.

Step 1: Obtain the Redis Socket Path

Log in to the mybox Panel and navigate to:

Advanced → Redis Server

Locate and copy the Redis socket path displayed there.

Example:

/home/mybox/YOUR-LOGIN/.redis/redis.sock

You will need this value later when editing the WordPress configuration file.

Step 2: Install the Redis Object Cache Plugin

  1. Log in to your WordPress administration panel.
  2. Navigate to:
Plugins → Add New
  1. In the search field, enter:
redis
  1. Locate the plugin:
Redis Object Cache
  1. Click:
Install Now
  1. After installation, click:
Activate

Step 3: Edit the wp-config.php File

Connect to your hosting account using FTP.

Navigate to your WordPress installation directory:

yourdomain.com/public_html

Locate the file:

wp-config.php

Open it for editing.

Step 4: Add Redis Configuration

Add the following lines above the line:

/* That's all, stop editing! Happy publishing. */

Replace the socket path with the value obtained from the mybox Panel.

/** Use Unix Socket */
define( 'WP_REDIS_SCHEME', 'unix' );

/** Redis Socket Path */
define( 'WP_REDIS_PATH', '/home/client.mybox.com/YOUR-LOGIN/.redis/redis.sock' );

Example:

define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/home/client.mybox.com/adrian/.redis/redis.sock' );

Save the file after making the changes.

Step 5: Verify the Connection

Return to your WordPress administration panel.

Navigate to:

Settings → Redis

or:

Tools → Redis

depending on the plugin version.

If everything has been configured correctly, you should see a message indicating that the plugin successfully connected to the Redis server.

Typical status messages include:

Connected

or

Redis server reachable

Step 6: Enable Object Cache

If the plugin displays an option such as:

Enable Object Cache

click it to activate Redis caching for your WordPress installation.

Once enabled, WordPress will begin storing object cache data in Redis.

Troubleshooting

Plugin Cannot Connect to Redis

Verify that:

  • Redis is enabled in the mybox Panel.
  • The socket path is correct.
  • The wp-config.php file contains the correct configuration.
  • There are no extra spaces or syntax errors in the file.

Redis Status Shows Disconnected

Double-check the value of:

WP_REDIS_PATH

and compare it with the socket path shown in the mybox Panel.

Website Displays Errors After Editing wp-config.php

Restore the original file or remove the Redis configuration lines and verify the syntax.

Even a missing semicolon can prevent WordPress from loading.

Benefits of Redis Object Cache

Using Redis can provide:

  • Faster page generation
  • Reduced MySQL load
  • Improved performance on busy websites
  • Better scalability
  • Lower server resource usage

Redis is particularly beneficial for:

  • WooCommerce stores
  • Membership websites
  • High-traffic blogs
  • Dynamic WordPress applications

Summary

To configure Redis Object Cache in WordPress:

  1. Enable Redis in the mybox Panel.
  2. Copy the Redis socket path.
  3. Install and activate the Redis Object Cache plugin.
  4. Edit wp-config.php and add:
define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/path/to/redis.sock' );
  1. Save the file.
  2. Verify the connection in the plugin settings.
  3. Enable Object Cache.

Once configured successfully, WordPress will use Redis for object caching, helping improve website performance and reduce database load.

Didn't find an answer?

Our support team is here for you 24/7 – write to us and we will help you sort it out.