Caching query strings
WP Rocket does not cache pages with query strings by default, although there are some very specific exceptions (see below).
A query string is where you have a URL that contains a question mark followed by a parameter and a value, like this:
example.com/page/?country=italy
In this case, country is the parameter and italy is the value.
If you want these types of pages to be cached, go to the Advanced Rules settings tab, and add each parameter in the Cache Query String(s) text field (one per line):
When you do this, a dedicated cache file will be generated for each value the parameter country receives in a URL.
If there are multiple parameters in a URL, as long as one of your specified parameters is present, the page will be cached.
For example, if country is a cached parameter, the following URL will be cached:
example.com/page/?country=italy&wine=red
Additionally, all special characters included in parameters will be stripped from the box but will still work. For example, if you have a country[] parameter, the Cache Query String(s) box will only show country. Despite this setting behavior, the caching will work for URLs such as
example.com/page/?country[]=italy
Special cases
Ignored query string parameters with standard caching
For all of the parameters listed below, WP Rocket will ignore the query string and serve the standard cache file, regardless of any parameter values in the URL. Here’s what that means:
example.com/about-us/?gclid=something example.com/about-us/?gclid=somethingelse // will BOTH receive the cache file from: example.com/about-us/
If you would like to customize the list of ignored parameters, please see this guide.
- Age Verify plugin:
age-verified - Autoptimize:
ao_noptimize - AMP:
usqp - Cookie Notice:
cn-reloaded - ShareASale:
sscid
ActiveCampaign
vgo_ee
Adobe Advertising Cloud
ef_id
Adobe Analytics
s_kwcid
Bronto
_bta_tid_bta_c
Dotdigital
dm_i
Facebook:
fb_action_idsfb_action_typesfb_sourcefbclidfbadid
Google Analytics and Ads:
utm_sourceutm_campaignutm_mediumutm_expidutm_termutm_contentutm_idutm_source_platformutm_creative_formatutm_marketing_tactic_gagclidcampaignidadgroupidadidgbraidwbraidgadidgad_sourcegad_campaignid
Google Web Stories:
_gl
Google DoubleClick
gclsrc
Google Shopping
srsltid
GoDataFeed
gdfmsgdftrkgdffi
Klaviyo
_ke_kx
Listrak:
trk_contacttrk_msgtrk_moduletrk_sid
Mailchimp:
mc_cidmc_eid
Marin
mkwidpcrid
Matomo:
mtm_sourcemtm_mediummtm_campaignmtm_keywordmtm_cidmtm_content
Microsoft Advertising
msclkid
Pinterest
epikpp
Piwik Pro:
pk_sourcepk_mediumpk_campaignpk_keywordpk_cidpk_content
Springbot
redirect_log_mongo_idredirect_mongo_idsb_referer_host
Please note: A dedicated cache file will be created when the parameters found in the dedicated caching section below or those placed on the Advanced Rules tab referenced above are included in the URL.
URLs with multiple ignored parameters
A query string can also contain multiple parameter/value pairs, chained by & characters. Example:
example.com/page/?utm_source=this&utm_campaign=that&utm_medium=theother
In cases where you have a mixture of ignored parameters (from the list above) and others not on the list, the page will not be cached. Parameters in the URL must all be present in the ignored list for the page to be cached.
Parameters with dedicated caching
langpermalink_namelp-variation-id
For all of the parameters listed above, WP Rocket will serve the dedicated cache file, depending on the parameter values in the URL. Here’s what that means:
example.com/about-us/?lang=english example.com/about-us/?lang=french // will create a dedicated cache file for their parameter/value pairs: ?lang=english ?lang=french
WooCommerce Geolocation Support
In WooCommerce there is the option to enable Geolocation (with page caching support):

When that option is active, WooCommerce appends a query string to each URL, like this:
v=42983b05e2f2
WP Rocket automatically caches those parameters.
Search results (dedicated caching)
The standard parameter for WordPress search results is: s
However, the Cache query strings option will not enable caching for this parameter. To cache search results, please install the helper plugin found here.
Caching query strings and Cloudflare APO
Cloudflare APO is not compatible with the Cache Query String(s) feature unless it's used along with Cache Everything. Please find more information here.
Parameters containing non-Latin or encoded characters
Parameters containing non-Latin or encoded characters cannot be added to the Cache Query String(s) text field to be cached, because special characters are ignored.
Query strings examples: attribute_%e9%a1%8f%e8%89%b2 , attribute_顏色
However, you can still add them by using the following helper plugin:
📥 Download (.zip): WP Rocket | Add Custom Cache Query Strings
Developers: You can find the code for this plugin on GitHub.
Heads up! The helper plugin doesn't work on its own. Manual code edit is required before use!
Use the README.md file for the specific details about how to apply each customization.
To customize the helper plugin, please:
- Download the helper plugin ZIP file and extract it.
- Open the
wp-rocket-add-custom-cache-query-strings.phpfile using a text/code editor. - Apply the required customization(s) as per the
README.mdfile. - Save changes.
- Compress the helper files into a ZIP file.
- On your site - go to Plugins → Add New → Upload plugin, and select the ZIP file.
- Activate the plugin.
If you need further help, please contact support.
