Remove Pagination query string

Forums › Forums › Search & Filter Pro › Remove Pagination query string

Viewing 6 posts – 1 through 6 (of 6 total)
  • Anonymous
    #198982

    I need to remove the ?sf_action=get_data&sf_data=all&sf_paged=2 from my page urls.

    I am loading search results via Ajax and infinite scroll. When the infinite scroll is triggered, all posts that are loaded have that query string appended—this is breaking critical redirects.

    How do I prevent this from happening?

    I have already added this function to my functions.php
    function _remove_script_version( $src ){
    $parts = explode( ‘?’, $src );
    return $parts[0];
    }
    add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1 );
    add_filter( ‘style_loader_src’, ‘_remove_script_version’, 15, 1 );

    Trevor
    #198997

    With the current version of the plugin, those query strings are needed for the plugin to work, sorry.

    Anonymous
    #199001

    Is there a way to bypass the query string so the redirect ignores everything but the base URL?

    So if I set a redirect for url.com/mypage to newurl.com but the search results puts url.com/mypage get pushed to the second page and now the url reads:
    url.com/mypage?sf_action=get_data&sf_data=all&sf_paged=2

    The redirect will break.

    Any idea how to get around that?

    Thanks for your help!

    Trevor
    #199050

    That would depend on how you write the redirect. I believe they can be written to ignore the query string, but then would that not break the search? I don’t know what you are trying to achieve with the redirect(s).

    Anonymous
    #199149

    The redirects send users to a Hubspot landing page from the search results page in WP. We aren’t directing users to the individual results pages in WP. I’ll try to find a solution for the redirects to ignore query strings—I haven’t found anything yet though.

Viewing 6 posts – 1 through 6 (of 6 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.