Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Taxonomy type request › Reply To: Taxonomy type request
May 13, 2025 at 1:29 pm
#53980
Keymaster
Hi Juan Pedro,
Sure! If I understand correctly, you want to redirect all of the results to the same page. For that you will need a small custom code snippet:
add_filter( 'asp_results', 'asp_custom_link_results', 10, 4 );
function asp_custom_link_results( $results, $search_id, $is_ajax, $args ) {
// Replaces each result URL with this
$replace_with = 'https://centuryseguros.es/page/url';
// --- DO NOT CHANGE ANYTHING BELOW ---
foreach ($results as $k=>&$r) {
if ( isset($r->link) ) {
$r->link = $replace_with;
}
}
return $results;
}
Just change the $replace_with variable on line 4 with the URL where you want to redirect the results. If you need help with it, let me know.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.