Advanced search form with filters for custom taxonomies

The reason you are losing your filters is because you are passing them through POST in the forms. This is fine, but you will have to store these values somehow for the pagination. I believe if you used GET, you may retain the values on “page 2”, but any POST values are lost as soon as you go to the next page.

You could store the search items in a session cookie, force the POST values for the next paginated page, or (what I recommend) use GET instead, it’s not like the search filter values are that important.

$next_link = get_permalink();

First echo out the get_permalink() value, it may retain your current args already. If not use add_query_arg() to retain them.

$next_link = add_query_arg( 'paged', ((int)$_GET['paged'])+1), $next_link);
// Do this as many times as you need to
$next_link = add_query_arg( 'your_filter', $_GET['your_filter'], $next_link);
$next_link = add_query_arg( 'your_other_filter', $_GET['your_other_filter'], $next_link);

tech