Title: [Plugin: WP Super Cache] Cache only for admin users
Last modified: August 19, 2016

---

# [Plugin: WP Super Cache] Cache only for admin users

 *  [Daniel Roch](https://wordpress.org/support/users/confridin/)
 * (@confridin)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-cache-only-for-admin-users/)
 * Hello,
 * I want to add an option, or a hack to Wp Super cache in order to cache pages 
   for every user, except admin users.
 * I just found an admin option, but it includes every user with comments…
 * How can i do such thing ?
 * Thanks for your help.

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

 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-cache-only-for-admin-users/#post-1610920)
 * You’ll have to modify the check in wp-cache-phase2.php so it only checks is_logged_in()
   instead of the cookies. Unfortunately you’ll have to do that modification every
   time you upgrade.
 *  Thread Starter [Daniel Roch](https://wordpress.org/support/users/confridin/)
 * (@confridin)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-cache-only-for-admin-users/#post-1611006)
 * Thanks for your help.
 * The solution is to add this code into the functions.php of the theme : :
 *     ```
       global $super_cache_enabled;
       if ( is_user_logged_in() ) {
       	$super_cache_enabled = false;
       	$cache_enabled = false;
       	if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Not caching for user logged In.', 5 );}
       ```
   
 *  Thread Starter [Daniel Roch](https://wordpress.org/support/users/confridin/)
 * (@confridin)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-cache-only-for-admin-users/#post-1611007)
 * I am mistaken : it doesn’t work in the functions.php file.
 * This code must be included in wp-cache-phase2, on line 360
 *     ```
       if ( is_user_logged_in() ) {
       	$super_cache_enabled = false;
       	$cache_enabled = false;
       	if ( isset( $GLOBALS[ 'wp_super_cache_debug' ] ) && $GLOBALS[ 'wp_super_cache_debug' ] ) wp_cache_debug( 'Not caching for user logged In.', 5 );}
       ```
   
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-cache-only-for-admin-users/#post-1611018)
 * Actually, there’s a hook in the cookie function. You could hook into that and
   check is_user_logged_in().

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

The topic ‘[Plugin: WP Super Cache] Cache only for admin users’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-cache-only-for-admin-users/#post-1611018)
 * Status: not resolved