Skip to content

Instantly share code, notes, and snippets.

@sybrew
Created June 29, 2025 05:11
Show Gist options
  • Save sybrew/0d426fc1eba277ce21852faf0ae19780 to your computer and use it in GitHub Desktop.
Save sybrew/0d426fc1eba277ce21852faf0ae19780 to your computer and use it in GitHub Desktop.
Disable TSF on page ID 12
<?php
// Do not include the opening PHP tag if PHP is already opened.
\add_filter(
'the_seo_framework_query_supports_seo',
/**
* Disables SEO support for page ID 12.
*
* @param bool $supported Whether the query supports SEO.
* @return bool
*/
function ( $supported ) {
// No need to process if the query already isn't supported.
if ( ! $supported )
return $supported;
$tsf_query = tsf()->query();
if ( $tsf_query->is_singular() && 12 === $tsf_query->get_the_real_id() )
$supported = false;
return $supported;
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment