Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Remove Pagination query string

Viewing 6 posts - 1 through 6 (of 6 total)
  • Jonathan King
    #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 Moderator
    #198997

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

    Jonathan King
    #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 Moderator
    #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).

    Jonathan King
    #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.

    Trevor Moderator
    #199151
Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.