Forums › Forums › Search & Filter Pro › Remove Pagination query string
Tagged: pagination, query strings, urls
- This topic has 5 replies, 2 voices, and was last updated 5 years, 11 months ago by Trevor.
-
Anonymous(Private) January 15, 2019 at 5:58 pm #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 );Anonymous(Private) January 15, 2019 at 6:27 pm #199001Is 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=2The redirect will break.
Any idea how to get around that?
Thanks for your help!
Anonymous(Private) January 16, 2019 at 5:20 pm #199149The 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.
-
AuthorPosts