Skip to content

Instantly share code, notes, and snippets.

@sybrew
Created March 27, 2024 01:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sybrew/6f75c9dc0c679f7c73db35c02209790b to your computer and use it in GitHub Desktop.
Save sybrew/6f75c9dc0c679f7c73db35c02209790b to your computer and use it in GitHub Desktop.
Disable canonical URL output of The SEO Framework v5.0 or later.
<?php
// Do not include the PHP opening tag if PHP is already open.
add_filter(
'the_seo_framework_meta_render_data',
function ( $tags_render_data ) {
unset( $tags_render_data['canonical'] );
return $tags_render_data;
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment