• I read on a previous thread that you require the premium version for a function to exclude query strings so that the cached version of the page is served.

    I bought the premium version and included this function in our functions.php file:

    function custom_wpo_cache_ignore_query_variables($exclude) {
    $new_variables = [
    'fbclid',
    'gclid',
    'gclsrc',
    'dclid',
    'gbraid',
    'wbraid',
    'twclid',
    'yclid',
    'utm_content',
    'utm_term',
    'utm_campaign',
    'utm_medium',
    'utm_source',
    'utm_id',
    'utm_source_platform',
    'utm_creative_format',
    'utm_marketing_tactic',
    '_ga',
    '_gl',
    'mc_cid',
    'mc_eid',
    '_bta_tid',
    '_bta_c',
    'trk_contact',
    'trk_msg',
    'trk_module',
    'trk_sid',
    'gdfms',
    'gdftrk',
    'gdffi',
    '_ke',
    '_kx',
    'redirect_log_mongo_id',
    'redirect_mongo_id',
    'sb_referer_host',
    'mkwid',
    'pcrid',
    'ef_id',
    's_kwcid',
    'msclkid',
    'dm_i',
    'epik',
    'pk_campaign',
    'pk_kwd',
    'pk_keyword',
    'piwik_campaign',
    'piwik_kwd',
    'piwik_keyword',
    'mtm_campaign',
    'mtm_keyword',
    'mtm_source',
    'mtm_medium',
    'mtm_content',
    'mtm_cid',
    'mtm_group',
    'mtm_placement',
    'matomo_campaign',
    'matomo_keyword',
    'matomo_source',
    'matomo_medium',
    'matomo_content',
    'matomo_cid',
    'matomo_group',
    'matomo_placement',
    'hsa_cam',
    'hsa_grp',
    'hsa_mt',
    'hsa_src',
    'hsa_ad',
    'hsa_acc',
    'hsa_net',
    'hsa_kw',
    'hsa_tgt',
    'hsa_ver',
    '_branch_match_id',
    'mkevt',
    'mkcid',
    'mkrid',
    'campid',
    'toolid',
    'customid',
    'igshid',
    'si',
    'sms_source',
    'sms_click',
    'sms_uph',
    'ttclid',
    'ndclid',
    'ScCid',
    'rtid',
    'irclickid',
    'srsltid'
    ];
    $exclude = array_merge($exclude, $new_variables);
    return $exclude;
    }
    add_filter('wpo_cache_ignore_query_variables', 'custom_wpo_cache_ignore_query_variables');

    /------------------------------------------------------------------------/
    /------------------------------------------------------------------------/

    Unfortunately, this doesn’t work. I tested this on an organic result that includes the “?srsltid” query string. When viewing the source of a page, I see this message in the footer: <!– WP Optimize page cache – https://getwpo.com – Page not served from cache –>

    I want to serve cached pages for users from organic searches on Google, Google Ads, and any meta campaigns.

    For example, on some organic results, this is added to the end of the URL: ?srsltid=xxx where xxx is an ID.

    How can we serve cached pages to those users?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support wpmansour

    (@wpmansour)

    Thank you for reaching out and providing detailed information about the issue you’re encountering. It’s great that you’ve implemented the custom function to exclude query strings.

    From what you’ve described, the problem might be related to how certain query variables are handled very early in the caching process. Could you please verify if any of the following query variables are being excluded in your environment, as these are automatically excluded by WP-Optimize.

    However, I have raised your concern with the development team, and we are actively working on determining the right way to handle these scenarios to avoid failures in certain cases.

    Thread Starter Anton Koekemoer

    (@antonkoekemoer)

    No, nothing is excluded except those items in the function.

    Plugin Support wpmansour

    (@wpmansour)

    Our development team has acknowledged the issue and prioritized it. We are actively working on a fix, and it will be addressed in one of our upcoming releases.

    We appreciate your patience and understanding, and we thank you for bringing this to our attention and providing such detailed information.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.