Last active
May 10, 2018 20:14
-
-
Save timersys/2f318678d81b3397c53d76843669e651 to your computer and use it in GitHub Desktop.
Change WpRocket cache level for Geotargeting WP or disable it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* By default WpRocket plugin will create different cache pages at a country level | |
* To add more levels (states or cities) you need to add the following filter | |
*/ | |
add_filter('rocket_geotargetingwp_enabled_cookies', function($enable){ | |
$enable[] = 'state'; | |
//$enable[] = 'city'; | |
return $enable; | |
}); | |
/** | |
* To DISABLE all cookies because for example don't want to use cache mode | |
* you can add this code | |
*/ | |
add_filter('rocket_geotargetingwp_enabled_cookies', function(){ return [];}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment