If you want to remove canonical URLs from search results in WordPress, and you use WordPress SEO by Yoast, add the following filter to your child theme’s functions.php file:
function yoast_remove_canonical_search( $canonical ) {
if( is_search() ) {
return false;
} else {
return $canonical;
}
}
add_filter('wpseo_canonical', 'yoast_remove_canonical_search');More on what a canonical tag is and how to use it in the post What is a Canonical Tag and how to use it?