Canonical URL information is injected into the head of your webpage when using Yoast SEO plugin. If you need to remove the injected canonical URL from a particular single page or post you can do so with the below code snippet by placing it into your functions.php file within your WordPress theme.
Canonical URL helps deal with duplicate content issues by utilize the rel=canonical tag. The rel=canonical tag passes ranking power like a 301 redirect and takes less time to implement.
[code]
function wpseo_canonical_exclude( $canonical ) {
global $post;
if ( $post->ID == -1) {
$canonical = false;
}
return $canonical;
}
add_filter( ‘wpseo_canonical’, ‘wpseo_canonical_exclude’ );
[/code]