This guide shows you how to trouble-shoot and fix Redis Out-of-Memory Error in WordPress;
OOM command not allowed when used memory > 'maxmemory'
What You’ll See
- A white screen or admin notice: “Error establishing a Redis connection”
- Features that rely on the WordPress object cache stop working or return errors
- The error message may include:
OOM command not allowed when used memory > 'maxmemory' - The problem typically appears intermittently at first, then becomes permanent until Redis is cleared
Example error message
OOM command not allowed when used memory > 'maxmemory'. WordPress is unable to establish a connection to Redis. This means that the connection information in your wp-config.php file are incorrect, or that the Redis server is not reachable. Is the correct Redis host and port set? Is the Redis server running? If you need help, please read the installation instructions. To disable Redis, delete the object-cache.php file in the /wp-content/ directory.
What’s Happening
Your WordPress is using Redis as an object cache, a fast in-memory store for database query results, options, and other data. Redis significantly speeds up page loads by avoiding repeated database queries.
By default, Redis is configured with maxmemory-policy noeviction. This means once Redis reaches its memory limit, it stops accepting all write commands and returns an OOM (Out of Memory) error. WordPress’s object cache driver treats this as a fatal error, which surfaces as “Error establishing a Redis connection” even though Redis itself is running fine.
The root cause is almost always a plugin or theme writing unexpectedly large data into the object cache. Common culprits include:
- Search or AI plugins that store document embeddings or large index arrays as post meta
- WooCommerce or membership plugins that cache large serialised objects
- Any plugin using
update_meta_cache()broadly, which bulk-loads all post meta for a set of posts — including large fields — into Redis at once
Once that data fills Redis, every subsequent request fails, including ones that would normally write small, innocuous data.
Resolution
There are two steps: clear the full cache now, and prevent it filling up again.
Step 1 — Flush the Redis Cache
Flushing Redis clears all cached data. WordPress will rebuild its cache automatically on the next page load — there is no loss to your content or database.
Via your Ecenica hosting control panel (cPanel / LiteSpeed WebAdmin)
- Log in to cPanel
- Navigate to Advanced → Redis (or search for “Redis” in the top bar)
- Click Flush or Clear All Data
If your control panel does not have a Redis management tool, contact us to upgrade to a plan with Redis.
Via WP-CLI (if you have SSH access)
wp cache flush
After flushing, reload your site. The error should clear immediately.
Step 2 — Fix the Underlying Cause
Flushing Redis provides immediate relief but does not address the root cause. If the same plugin continues writing large data into the object cache, it will fill up again.
Check which plugin is responsible
Look for plugins that handle large datasets — AI assistants, search indexing, document management, or membership systems with bulk user data. Review whether those plugins cache data that is large in size (arrays of numbers or floats, serialised objects over a few kilobytes) or use WordPress’s update_meta_cache() across many posts at once.
The correct fix is in the plugin code
Large data, especially data only needed for a single request — should not go through the WordPress object cache. The plugin should query the database directly for that specific data rather than using get_post_meta() or update_meta_cache(), which routes through Redis. A well-written plugin will either:
- Use a direct
$wpdbquery scoped to only the fields it needs, bypassing the object cache entirely, or - Call
wp_cache_delete()immediately after use for any large values it does cache
If the plugin is a third-party one, report the issue to its developer. If it is a custom plugin, any query that loads large meta values should be audited and rewritten to bypass the object cache for that data.