Title: Change Cache Directory
Last modified: September 1, 2016

---

# Change Cache Directory

 *  [timmen22](https://wordpress.org/support/users/timmen22/)
 * (@timmen22)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/change-cache-directory-3/)
 * Hello,
 * I changed the cache directory of the w3tc plugin by adding the code below to 
   the wp-config.php file.
 * `defined('WP_CONTENT_DIR') || define('WP_CONTENT_DIR', realpath(W3TC_DIR . '/../../
   wtc_cache'));`
 * The directory is changed, but when I try to clear the page cache it isn’t working
   anymore. Purge the page cache automatically after updating a page/post does not
   work either. Does anyone know a solution to solve the problem?
 * Thanks for helping me.
 * Regards
 * [https://wordpress.org/plugins/w3-total-cache/](https://wordpress.org/plugins/w3-total-cache/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Kimberly](https://wordpress.org/support/users/amiga500/)
 * (@amiga500)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/change-cache-directory-3/#post-7672305)
 * Actually, replace what you did in _wp-config.php_ with this:
 *     ```
       define('W3TC_CACHE_DIR', ABSPATH.'wp-content/wtc_cache');
       ```
   
 * But just make sure that line is placed anywhere above this existing line:
 *     ```
       require_once(ABSPATH . 'wp-settings.php');
       ```
   
 * Kimberly
 *  Thread Starter [timmen22](https://wordpress.org/support/users/timmen22/)
 * (@timmen22)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/change-cache-directory-3/#post-7672318)
 * Thanks for your quick response Kimberly.
 * Replacing the code solved my problem. Thanks!
 *  Thread Starter [timmen22](https://wordpress.org/support/users/timmen22/)
 * (@timmen22)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/change-cache-directory-3/#post-7672564)
 * Hi again,
 * I noticed that the solution is working for the “enhanced” caching method. When
   I switch to the “basic” caching method purging the cache does not work.
 * It would be great if anyone can resolve the problem.
 * Thanks for helping me.
 *  [Kimberly](https://wordpress.org/support/users/amiga500/)
 * (@amiga500)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/change-cache-directory-3/#post-7672595)
 * Hi there. I did a test and it works for me. (i switched to “basic”). Not sure
   what you are doing wrong that would cause this. Would need more info.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Change Cache Directory’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [W3TC](https://wordpress.org/support/topic-tag/w3tc/)

 * 4 replies
 * 2 participants
 * Last reply from: [Kimberly](https://wordpress.org/support/users/amiga500/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/change-cache-directory-3/#post-7672595)
 * Status: not resolved