How to Enable WordPress Memcached and Stop Losing Visitors

WordPress Memcached

Table of Contents

Get up to 50% off now

Become a partner with CyberPanel and gain access to an incredible offer of up to 50% off on CyberPanel add-ons. Plus, as a partner, you’ll also benefit from comprehensive marketing support and a whole lot more. Join us on this journey today!

For visitors to your site, Speed matters more than anything! That’s why, WordPress Memcached is one of the best tools to supercharge your site’s speed and enhance user experience.

This guide is your one-stop solution! Together we explore what WordPress Memcached is, why it’s so important, besides helping you find the best Memcached plugins for WordPress and how to enable it.

What is Memcached?

how to- enable-wordpress-memcached-in-2025

Memcached is a cool caching tool that helps keep servers running smoothly, even when they’re super busy.

It’s an open-source, distributed memory caching system designed to lighten the load on databases for dynamic web apps, like online stores or sites that require user logins. Created by Brad Fitzpatrick back in 2003, Memcached is now a go-to solution for big names like Facebook, Twitter, YouTube, and Wikipedia, as well as smaller web applications.

Memcached operates on a client-server setup that includes four main parts:

  1. A client server that keeps track of all the Memcached servers available.
  2. A hashing algorithm on the client side that selects a server based on the requested “key.”
  3. Server software that saves the key-value pairs in an internal hash table.
  4. A Least Recently Used (LRU) algorithm that determines when to replace old data or free up memory.

Memcached is set up as a Least Recently Used cache right out of the box. This means that items will expire after a certain time. These features are great for tackling various issues; for instance, you can let items expire after a minute to avoid serving outdated data or clear out data that hasn’t been used to keep the most requested info handy.

Tech Delivered to Your Inbox!

Get exclusive access to all things tech-savvy, and be the first to receive 

the latest updates directly in your inbox.

Further, It works by storing data and objects right in the server’s memory (RAM), which means it cuts down on how often external sources, like databases or API calls, need to be accessed. This game-changer for dynamic platforms like WordPress or Joomla!, as it speeds up processing times!

Why is WordPress Memcached Important for Site Speed?

Slow websites don’t just frustrate users, they hurt your bottom line. Many don’t know that enabling WordPress Memcached can boost your site’s traffic and page load times by 50-70%. Now let’s see why it’s so important:

Memcached has a big perk: it keeps all its data in RAM, so you don’t have to wait for it to load from the disk every time you need something.

Another cool thing is that there are no limits on the type of data you can cache. Whether it’s documents, images, or even more complex data structures, Memcached can handle it all.

Plus, if one of your Memcached servers goes down, it’s usually not a huge deal, depending on how you’ve set things up. Most of the time, people use Memcached as a read-only cache or for temporary data. If you’re using it for data that needs to stick around, you can always switch to another method to reload that data into the RAM of a different server.

How to Enable Memcached WordPress?

Here’s how you can enable WordPress Memcached:

Step 1: Install Memcached on your Server

To get Memcached up and running, start by connecting to your server through SSH and enter this command:

yum install memcached

Once it’s installed, kick it off with:

service memcached start

Next, we need to set up PECL Memcached for the right PHP version. Since WordPress works great with PHP 7, let’s go ahead and enable Memcached for PHP 7.1. First, install the required packages to add our custom PHP module in Plesk:

yum install make plesk-php71-devel gcc glibc-devel libmemcached-devel zlib-devel

Now, build the module using these commands. You can just hit Enter when asked for the libmemcached directory.

Enhance Your CyerPanel Experience Today!
Discover a world of enhanced features and show your support for our ongoing development with CyberPanel add-ons. Elevate your experience today!

/opt/plesk/php/7.1/bin/pecl install memcached

After that, we need to add a line to the relevant configuration file to register the module in PHP. You can do this straight from the command line without opening the ini file.

echo "extension=memcached.so" > /opt/plesk/php/7.1/etc/php.d/memcached.ini

Finally, refresh the PHP handlers so you can see the module in the PHP overview in the Plesk GUI.

plesk bin php_handler --reread

Now, check the phpinfo() page to see if the memcached module loaded correctly.

Memcached php configuration<br>Memcachedphpinfo() output

Or you can check it directly from the command line:

/opt/plesk/php/7.1/bin/php -i | grep "memcached support".

Step 2: Configure WordPress for Memcached

To set up WordPress with Memcached, you will require either a caching plugin or a custom setup. Follow these steps:

  1. Install a caching plugin such as W3 Total Cache or LiteSpeed Cache.
  2. Activate Memcached in the plugin’s settings. For instance:
    In W3 Total Cache, navigate to Performance > General Settings and enable Memcached for Object Cache.
  3. Check if Memcached is functioning correctly.
    Run this command to verify that Memcached is operational:
echo "stats settings" | nc localhost 11211


If Memcached is working correctly, you will see a list of statistics.

Step 3: Activate Memcached in WordPress

After installing Memcached on your server, enabling it in WordPress is straightforward. Start by activating the Memcached backend using a script that automatically detects the caching mechanism.

Download the script from https://github.com/bonny/memcachy and place all files in the /wp-content/ directory.

If you haven’t modified the default port (11211) for Memcached, you can use it right away. If you have changed the port, you will need to add the following code to your wp-config.php file located at the root of your WordPress installation:

$memcached_servers = array( array( '127.0.0.1', 11211 ) );

Once the backend is set up, install a caching plugin to manage and serve cached pages through Memcached. Use the Batcache plugin (https://wordpress.org/plugins/batcache/) by following these installation steps:

  1. Download and extract the plugin package.
  2. Upload the advanced-cache.php file to the /wp-content/ directory.
  3. Edit wp-config.php to include the line:
    define(‘WP_CACHE’, true);
    Note: Ensure that Memcached is properly enabled for your PHP version before adding this line to avoid errors!
  4. Upload the batcache.php file to the /wp-content/plugins/ directory.

That’s it! You can now open the advanced-cache.php file to customize the settings as needed.

The batcache.php file acts as a lightweight plugin that refreshes the cache for posts and pages. Remember to activate the plugin from the backend on the plugins page!

Step 4: Check if Memcached is functioning correctly in WordPress

To confirm that everything is set up properly, the simplest method is to add a header field to the response to see if the rendered page was served from the cache.

To do this, modify the advanced-cache.php file. Open it and look for:

var $headers = array();

Change this line to:

var $headers = array('memcached' => 'activated');

Then, open your browser’s Developer Tools (F12 in Chrome), go to the Network tab, and refresh your website.

To check if everything is working properly, go to the Network tab and refresh your website a few times. This will help ensure the page loads from the cache. After that, take a look at the response headers. If you spot the memcached header field, then you’re all set!

Best Memcached Plugin for WordPress in 2025?

Here are the top 3 WordPress Memcached plugins you can use that are guaranteed to boost your sites performance and page load timesP

1. W3 Total Cache

W3 Total Cache (W3TC) basically:

  • Boosts SEO, Core Web Vitals, and overall user experience by speeding up website performance and cutting down load times.
  • Used and trusted by millions of publishers, developers, and hosting providers around the globe.
  • Helps improve rankings on search engine results pages, particularly for mobile-friendly and SSL-secured sites.
  • Can deliver at least a 10x boost in overall site performance when set up correctly.
  • Enhances conversion rates and overall site performance, positively impacting Google.com rankings.
  • Enables “instant” repeat page views thanks to browser caching.
  • Features optimized progressive rendering for quicker page loading and interaction.
  • Decreases page load times, encouraging visitors to stay longer on the site.
  • Enhances web server performance, especially during high traffic times.
  • Can save up to 80% in bandwidth by minifying HTML, CSS, and JS files.

2. LiteSpeed Cache

litespeed cache-Wordpress-memchached-plugin

A very famous memcached WordPress Cache plugin With server-level caching and optimization capabilities, LiteSpeed caching for WordPress is a complete site accelerator plugin that works with well-known plugins like WooCommerce, bbPress, Yoast SEO, and ClassicPress.

  • Automatic page caching to boost site speed significantly
  • Automatic clearing of related pages triggered by specific events
  • Private caching for users who are logged in
  • Caching for WordPress REST API requests
  • Distinct caching for desktop and mobile versions
  • Option to schedule cache clearing for certain URLs
  • Support for WooCommerce and bbPress
  • WordPress CLI commands available
  • API system for seamless cache integration
  • Exclude from cache using URI, Category, Tag, Cookie, or User Agent
  • Intelligent preload crawler that works with SEO-friendly sitemaps
  • Multiple crawlers to handle different cache variations

3. Redis Object Cache

Redis is a free, open-source caching tool for WordPress that keeps your data stored in memory. It can manage a variety of complex data types like strings, sets, streams, hashes, and lists, helping to reduce the strain on your MySQL database. This makes it a great choice for high-traffic sites with large amounts of data.

You can set custom time limits for how long data is stored, it supports asynchronous replication, offers four different saving modes, and uses SSDs for storage. It’s especially suited for real-time websites due to its speed and ability to provide quick responses.

  • Redis Database (RDB), Append Only File (AOF), no saving at all, or a combination of RDB and AOF are the four data saving options available.
  • Reliable storage, such as SSDs, is also used.
  • Quick reaction speed, perfect for websites that update in real-time.
  • Asynchronous replication is supported for effective queries.
  • Enables data-saving time restrictions and updates to be customized.

Benefits of Using Memcached on WordPress Sites

WordPress Memcached offers several Benefits such as:

  • Memcached speeds up response times to just microseconds, boosting app performance and enhancing user experience.
  • It’s super flexible, and able to manage different data types like integers, strings, arrays, and objects.
  • Memcached is easy to use, open source, and works with a bunch of programming and database languages.
  • Thanks to its multithreaded design, it can scale across servers and utilize multiple core processors on one node.
  • It lightens the load on databases, cutting down the number of queries the host server has to handle.
  • With a large, helpful community, you can get support when you need it, plus it backs open data formats.
  • Memcached is budget-friendly, helping you avoid expensive hosting plans and hardware upgrades.

Conclusion: Final Tips for Leveraging WordPress Memcached

WordPress Memcached is a game-changer for speed optimization whether your running a personal blog or high traffic site. The simplicity, speed, and scalability of Memcached make it a popular caching solution for WordPress websites, improving performance and lessening the strain on backend databases.

This article provides simple steps on how to enable Memcached in WordPress that anyone can follow and implement to boost your site’s speed in 2025 and the top 3 best Memcached plugin for WordPress. Time to get rid of slugging sites!!

FAQ’s

1. What’s WordPress Memcached, and why does it matter for WordPress?
Memcached is a caching tool that boosts website speed by keeping frequently accessed data in memory, which lightens the server load and enhances loading times.

2. Does Memcached work with every WordPress hosting provider?
Not every hosting provider supports Memcached WordPress. It’s a good idea to check with your host or think about upgrading to a plan that offers Memcached support.

3. How can I check if Memcached is set up on my server?
You can check by running the command memcached -h through SSH or by looking in your hosting control panel for Memcached options.

4. What are the top plugins to enable Memcached on WordPress?
The most popular ones are W3 Total Cache and Redis Object Cache, both of which support Memcached integration.

5. Can I enable Memcached if I don’t have server access?
Some managed WordPress hosting services come with Memcached already set up, so you won’t need server access. Just check with your hosting provider for specifics.

6. What if Memcached goes down?
If Memcached fails, your website might slow down temporarily as it falls back to database queries. Regular monitoring can help prevent any issues.

7. Is Memcached superior to Redis for WordPress?
It really depends on what you need. Memcached is straightforward and faster for basic caching, while Redis provides more advanced features and flexibility.

8. Do I need coding skills to turn on Memcached in WordPress?
Not really. Many plugins let you enable Memcached without any coding skills, but configuring it at the server level might need some technical help.

9. How can I check if Memcached is speeding up my site?
You can use tools like GTmetrix or PageSpeed Insights to see if there’s a speed boost after enabling Memcached.

Areeba Nauman
Areeba is a Content Writer with expertise in web content and social media, she can simplify complex concepts to engage diverse audiences. Fueled by creativity and driven by results, she brings a unique perspective and a keen attention to detail to every project she undertakes with her creativity and passion for delivering impactful content strategies for success. Let's connect on Linkedin: https://www.linkedin.com/in/areeba-bhatti/
Unlock Benefits

Become a Community Member

SIMPLIFY SETUP, MAXIMIZE EFFICIENCY!
Setting up CyberPanel is a breeze. We’ll handle the installation so you can concentrate on your website. Start now for a secure, stable, and blazing-fast performance!