Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Problems with external links assearch results › Reply To: Problems with external links assearch results
January 9, 2023 at 1:48 pm
#40821
Keymaster
Hi,
Well, the plugin can not affect how the links work especially not on the results page, this might be a theme related issue – although I am not exactly sure about that either.
Depending on how these custom links are added, the template very likely prints them via the get_permalink, call. However these links are changed, there should be a hook added somewhere to this core WordPress function to change the permalink accordingly.
In your case the title seems to be the link URL, so something like this could maybe do the trick:
add_filter('post_link', 'asp_add_post_link', 10, 3);
function asp_add_post_link( $permalink, $post, $leavename ) {
$title = get_the_title($post);
if ( strpos($title, 'https://') ) {
return $title;
}
return $permalink;
}
This is just a wild guess though.