How to change the results URL to something else?

What is this, and where do I put this custom code?

add_filter( 'asp_results', 'asp_custom_link_results', 10, 1 );
function asp_custom_link_results( $results ) {
// Parse through each result item
foreach ($results as $k=>$v) {
/**
* In this context the
* $results[$k]->link
* variable holds the result link. Make modifications to that variable.
*/
$results[$k]->link = 'https://google.com';
}
return $results;
}

Parsing the url from post meta

What is this, and where do I put this custom code?

// Live results URLs
add_filter( 'asp_results', 'asp_custom_link_meta_results', 10, 1 );
function asp_custom_link_meta_results( $results ) {
// Change this variable to whatever meta key you are using
$key = 'custom_url';
// Parse through each result item
foreach ($results as $k=>&$r) {
if ( function_exists('get_field') )
$new_url = get_field( $key, $r->id, true ); // ACF support
else
$new_url = get_post_meta( $r->id, $key, true );
// Change only, if the meta is specified
if ( !empty($new_url) ) {
$r->link = $new_url;
}
}
return $results;
}
// Results page URLs
add_filter('asp_regular_search_result', 'asp_custom_link_meta_results_res_page', 10, 2);
function asp_custom_link_meta_results_res_page( $post, $r ) {
$key = 'custom_url';
if ( function_exists('get_field') )
$new_url = get_field( $key, $post->ID, true ); // ACF support
else
$new_url = get_post_meta( $post->ID, $key, true );
if ( !empty($new_url) ) {
$post->asp_guid = $new_url;
}
return $post;
}