Sign Up For Web Hosting Now!
SuperCacher Services
No.1 Web Host!
  • Free Domain name
  • Unlimited space
  • Unlimited traffic
  • Immediate activation
  • 24/7 Support
  • 99.9% Uptime
  • 30 Days Money Back
Sign up now Learn more
Facebook Twitter Plusone

How to configure WordPress to use Memcached

In this tutorial we will explain how to configure your WordPress application to use Memcached. By default, WordPress does not provide Memcached support. That is why you have to install a third party plugin which can be used by the WordPress system to connect to the Memcached service. You need to install W3 Total Cache. For more details regarding the plugin please check this page:


The plugin can be installed directly from your WordPress administrative area. You can access the WordPress Dashboard at:

http://yourdomain.com/wp-admin/

Please note that you should replace yourdomain.com with your own domain name. You should see the WordPress login page:

WordPress login


Type your username and password and then click the "Log In" button. The next page which will be displayed on your end is the WordPress Dashboard which allows you to manage your website. To install the W3 Total Cache plugin go to Plugins --> Add New:

WordPress plugins link


The system will redirect you to the WordPress plugins management web interface. You will see a "Search" text field. Type "W3 Total Cache" in the field and click the "Search" button. You may need to wait several seconds for WordPress to find the W3 Total Cache plugin. On the results page click the "Install Now" button below the W3 Total Cache plugin:

WordPress install plugin link


When you click the "Install Now" button WordPress will download the plugin for you and install it. You will then be redirected to a page which allows you to enable the plugin. To do this click on the "Activate Plugin" button:

WordPress Activate Plugin link

At this stage W3 Total Cache is installed and activated. This means that now your WordPress application supports Memcached. The next step is to edit the plugin files and configure it to use the correct hostname and port combination. For more details how to find out the correct details please check the following tutorial:

Enable Memcached from cPanel

In our example, the correct details are:

Memcached IP address: 127.0.0.1
Memcached Port: 20006

Please note that when you enable Memcached the system will randomly generate a port for you. You should remember the port number. The next step is to manually edit the following file on your account:

wp-content/w3-total-cache-config-preview.php

You have to find the following text string in the code:

127.0.0.1:11211

and replace it with:

127.0.0.1:20006

As you can see the idea is to replace the default Memcached port (11211) with the correct port for your account. You can now access the WordPress administrative area and configure the plugin from the Plugins section.
Previous Next
(c) Copyright 2004-2013 SiteGround. All rights reserved