Home / Admin / Prevent Canonical URL tag output on Posts
Duplicate Snippet

Embed Snippet on Your Site

Prevent Canonical URL tag output on Posts

This snippet can be used to prevent AIOSEO from outputting the Canonical URL tag on posts

10+
Code Preview
php
<?php
add_filter( 'aioseo_canonical_url', 'aioseo_filter_canonical_url' );
function aioseo_filter_canonical_url( $url ) {
   if ( is_singular() ) {
      return '';
   }
   return $url;
}

Comments

Add a Comment