Title: Menu &#8220;Delete Cache&#8221; button causes undefined function get_supercache_dir
Last modified: June 15, 2017

---

# Menu “Delete Cache” button causes undefined function get_supercache_dir

 *  [mclaurent](https://wordpress.org/support/users/mclaurent/)
 * (@mclaurent)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/menu-delete-cache-button-causes-undefined-function-get_supercache_dir/)
 * Hi
 * Whenever I click on “Delete cache” in the WP-Admin menu, I get a white screen
   and the following error logged. When I go to WP-Admin > Settings > WP Super Cache
   > Contents > Delete Cache it works fine. There are no warnings on the WP-Cache
   page, and the plugin works fine otherwise.
 *     ```
        Got error 'PHP message: PHP Fatal error:  Call to undefined function get_supercache_dir() in /var/www/vhosts/website.com/website/wp-content/plugins/wp-super-cache/wp-cache.php on line 423
       ```
   
 * Any ideas?
    -  This topic was modified 8 years, 11 months ago by [mclaurent](https://wordpress.org/support/users/mclaurent/).

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

 *  Thread Starter [mclaurent](https://wordpress.org/support/users/mclaurent/)
 * (@mclaurent)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/menu-delete-cache-button-causes-undefined-function-get_supercache_dir/#post-9233785)
 * I think I’m getting somewhere. Could it have something to do with the face that
   the WPCACHEHOME is actually set in an include of wp-config.php. So I am not setting
   WPCACHEHOME in wp-config.php, but in wp-config.inc.php.
 * My wp-config.php
 *     ```
       <?php
       /**
        * The base configurations of the WordPress.
        *
        * This file has the following configurations: MySQL settings, Table Prefix,
        * Secret Keys, and ABSPATH. You can find more information by visiting
        * {@link http://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php}
        * Codex page. You can get the MySQL settings from your web host.
        *
        * This file is used by the wp-config.php creation script during the
        * installation. You don't have to use the web site, you can just copy this file
        * to "wp-config.php" and fill in the values.
        *
        * @package WordPress
        */
   
       require_once(dirname(dirname(__FILE__)).'/config/wp-config.inc.php');
   
       /* That's all, stop editing! Happy blogging. */
   
       /** Absolute path to the WordPress directory. */
       if ( !defined('ABSPATH') )
               define('ABSPATH', dirname(__FILE__) . '/');
   
       /** Sets up WordPress vars and included files. */
       require_once(ABSPATH . 'wp-settings.php');
       ```
   
    -  This reply was modified 8 years, 11 months ago by [mclaurent](https://wordpress.org/support/users/mclaurent/).
    -  This reply was modified 8 years, 11 months ago by [mclaurent](https://wordpress.org/support/users/mclaurent/).
 *  Thread Starter [mclaurent](https://wordpress.org/support/users/mclaurent/)
 * (@mclaurent)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/menu-delete-cache-button-causes-undefined-function-get_supercache_dir/#post-9233854)
 * I think this seems indeed to be the cause. I have now removed the line from wp-
   config.inc.php that defined WPCACHEHOME, and let the plug-in write the setting
   itself into wp-config.php.
 *  [gregorno](https://wordpress.org/support/users/gregorno/)
 * (@gregorno)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/menu-delete-cache-button-causes-undefined-function-get_supercache_dir/#post-9399062)
 * I had the same issue, same error message. Found this in my wp-config:
    `define('
   WP_CACHE', false);`
 * Re-enabling caching here solved the problem:
    `define('WP_CACHE', true);`
 * With this setting emptying the cache does not cause errors. Yay!
 *  [M.F. Jong](https://wordpress.org/support/users/mfjtf/)
 * (@mfjtf)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/menu-delete-cache-button-causes-undefined-function-get_supercache_dir/#post-9550880)
 * Fo some reason the define(‘WP_CACHE’, true); gets deleted from the config.php
   file

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

The topic ‘Menu “Delete Cache” button causes undefined function get_supercache_dir’
is closed to new replies.

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

## Tags

 * [delete cache](https://wordpress.org/support/topic-tag/delete-cache/)
 * [super cache](https://wordpress.org/support/topic-tag/super-cache/)

 * 4 replies
 * 3 participants
 * Last reply from: [M.F. Jong](https://wordpress.org/support/users/mfjtf/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/menu-delete-cache-button-causes-undefined-function-get_supercache_dir/#post-9550880)
 * Status: not resolved