Title: Empty cache does not work
Last modified: February 8, 2017

---

# Empty cache does not work

 *  Resolved [dinel2016](https://wordpress.org/support/users/dinel2016/)
 * (@dinel2016)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/empty-cache-does-not-work/)
 * Hello,
 * I’ve just realised that empty cache does not work. I don’t know whether this 
   is something new or it hasn’t been working for a while. I noticed that the references
   were not displayed on my website and it turned out to be because the token has
   expired. After I renewed the token, I tried to empty cache and it was still not
   working (but working if I selected a different folder). I had a look at the cache
   table and it still had content.
 * It seems to me that the root of the problem is the use of dbDelta on line 1564.
   My understanding is that dbDelta is used for different purposes. I manually deleted
   the contents of the cachetable and the references were displayed again.
 * Shouldn’t $wpdb->query be used instead? (i.e. $wpdb->query($sql))
    [https://codex.wordpress.org/Class_Reference/wpdb#Running_General_Queries](https://codex.wordpress.org/Class_Reference/wpdb#Running_General_Queries)
 * Cheers

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

 *  [poundsixzeros](https://wordpress.org/support/users/poundsixzeros/)
 * (@poundsixzeros)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/empty-cache-does-not-work/#post-8782569)
 * (I’m not the plugin author but…)
    I think it’s been broken for a while. Every
   time I either update the plugin or change anything in the configuration I’ve 
   found that I have to manually delete the cache from the db and also delete the
   access token and then refresh it.
 *  Thread Starter [dinel2016](https://wordpress.org/support/users/dinel2016/)
 * (@dinel2016)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/empty-cache-does-not-work/#post-8785329)
 * I updated one of my sites and decided to change the code of the plugin. The version
   I proposed works like a charm. If you do not want to wait till the next version
   of the plugin is out you can change the code at line 1559 (I included plenty 
   of context so it is possible to see where the change is). The two commented lines
   are not necessary.
 *     ```
       			if (isset($_POST['emptycache_mendeleyPlugin'])) {
       			        global $wpdb;
       			        $table_name = $wpdb->prefix . "mendeleycache";
       				$sql = "delete from ".$table_name." where id>0";
       				//require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
       				//dbDelta($sql);
       				$wpdb->query($sql);
       ?>
       <div class="updated"><p><strong><?php _e("Caches emptied.", "MendeleyPlugin"); ?></strong></p></div>
       <?php
       			}
       ```
   
    -  This reply was modified 9 years, 3 months ago by [dinel2016](https://wordpress.org/support/users/dinel2016/).
 *  Plugin Author [kochm](https://wordpress.org/support/users/kochm/)
 * (@kochm)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/empty-cache-does-not-work/#post-8798001)
 * Thanks a lot for this constructive feedback! I included the patch in the latest
   version of the plugin. Another change included in the latest backup is the long
   seeded bugfix for the automatic refreshing of Mendeley access tokens …

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

The topic ‘Empty cache does not work’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mendeleyplugin.svg)
 * [Mendeley Plugin](https://wordpress.org/plugins/mendeleyplugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mendeleyplugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mendeleyplugin/)
 * [Active Topics](https://wordpress.org/support/plugin/mendeleyplugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mendeleyplugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mendeleyplugin/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [kochm](https://wordpress.org/support/users/kochm/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/empty-cache-does-not-work/#post-8798001)
 * Status: resolved