// Remove the line below, if you don't want to affect the Live results list
add_filter( 'asp_results', 'asp_custom_link_meta_results', 10, 4 );
// Remove the line below, if you don't want to affect the results page
add_filter( 'asp_noajax_results', 'asp_custom_link_meta_results', 10, 4 );
function asp_custom_link_meta_results( $results, $search_id, $is_ajax, $args ) {
// Change this variable to whatever meta key you are using
$meta_key = 'custom_url';
// --- DO NOT CHANGE ANYTHING BELOW ---
foreach ($results as $k=>&$r) {
if ( function_exists('get_field') )
$new_url = get_field( $meta_key, $r->id, true ); // ACF support
$new_url = get_post_meta( $r->id, $meta_key, true );
// Change only, if the meta is specified
if ( !empty($new_url) ) {
if ( isset($r->asp_guid) ) {