• Resolved confusedneedhelp

    (@confusedneedhelp)


    Hi,

    I use URL parameters on my homepage. The problem I have is that the page is being cached on the first load and subsequent changes in URL parameters do not update the page.

    If I add the homepage to the list of excluded pages “/” it does not stop the homepage with URL parameters being cached.

    I have to add the “/*” to the list of excluded pages and it works. However, this then excludes every page on my site which is bad.

    How can I stop a page with URL parameters being cached?

    Thanks for your help.

Viewing 1 replies (of 1 total)
  • Thread Starter confusedneedhelp

    (@confusedneedhelp)

    I think I just found the answer, sorry!

    add_filter( 'sgo_bypass_query_params', 'add_sgo_bypass_query_params');
    function add_sgo_bypass_query_params( $bypass_query_params ) {
        // Add custom query params, that will skip the cache.
        $bypass_query_params[] = 'query_param';
        $bypass_query_params[] = 'query_param2';
    
        return $bypass_query_params;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Home Page Being Cached with URL Parameters’ is closed to new replies.