Skip to content

Instantly share code, notes, and snippets.

@sybrew
Created January 20, 2025 18:21
Show Gist options
  • Save sybrew/6a82d82faf9f0b139fbe3327c98d593e to your computer and use it in GitHub Desktop.
Save sybrew/6a82d82faf9f0b139fbe3327c98d593e to your computer and use it in GitHub Desktop.
Unset Schema for TSF on listings Custom Post Type
<?php
// Do not include the PHP opening tag if PHP is already opened.
add_filter(
'the_seo_framework_meta_generator_pools',
function ( $generator_pools ) {
if ( 'listings' === tsf()->query()->get_post_type_real_id() )
return array_diff( $generator_pools, [ 'Schema' ] );
return $generator_pools;
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment