• Is it possible to ignore specific url parameters?

    For example:
    example.com/url?gclid=xxxxxxxxx
    example.com/url?gclid=yyyyyyyyy
    example.com/url?gclid=zzzzzzzzz

    this urls are now seen as unique pages which are all cached individually; but the content is exactly the same. Ideally I have a cached version which is served to all requests and ignore this parameter.

    Thanks!

Viewing 1 replies (of 1 total)
  • In file “wp-cache-phase1.php”
    after – $wp_cache_request_uri = $_SERVER[‘REQUEST_URI’];
    (77 line)

    You can add 4 lines to ignore gclid parameters

    //start
    $nrGetParams = strpos($wp_cache_request_uri, ‘?gclid’);
    if ($nrGetParams) {
    $wp_cache_request_uri = substr($wp_cache_request_uri, 0, $nrGetParams);
    }
    //end

    • This reply was modified 9 years, 3 months ago by cacko.
    • This reply was modified 9 years, 3 months ago by cacko.
    • This reply was modified 9 years, 3 months ago by cacko.
    • This reply was modified 9 years, 3 months ago by cacko.
    • This reply was modified 9 years, 3 months ago by cacko.
Viewing 1 replies (of 1 total)

The topic ‘Ignore parameters’ is closed to new replies.