In short. Use AIOSEO's aioseo_schema_disable filter and return true when the documented condition should suppress schema markup.
Definition: AIOSEO documents the
aioseo_schema_disablefilter as a code hook that prevents All in One SEO from outputting schema markup. The callback receives one Boolean value,$disabled, and returns the value that controls whether AIOSEO's schema output is disabled.
Key facts
- AIOSEO describes
aioseo_schema_disableas a filter for preventing All in One SEO from outputting schema markup in its filter reference. - The filter has one argument,
$disabled, which AIOSEO identifies as a Boolean describing whether schema markup should be suppressed. - The documented default for
$disabledisfalse. - AIOSEO's example applies the filter to WooCommerce products by testing for a singular
productand an active WooCommerce integration. - The reference page was last updated on August 14, 2026.
What does the Boolean return value mean?
The filter's input and output use the same Boolean contract. A returned true tells the documented filter path that AIOSEO should suppress its schema markup. A returned false keeps the disabled state off when no other callback has changed it. The reference labels the argument $disabled, describes it as whether AIOSEO should not output schema markup, and gives false as its default.
The example callback keeps the incoming value when its condition does not match. That preserves the value supplied to the callback and makes the example conditional rather than a site-wide override.
What code does AIOSEO document?
AIOSEO's embedded example is titled “Disable Schema Output for WooCommerce products.” The code uses the WordPress add_filter call with the hook name and a named callback:
add_filter( 'aioseo_schema_disable', 'aioseo_disable_schema_products' );
function aioseo_disable_schema_products( $disabled ) {
if ( is_singular( 'product' ) && aioseo()->helpers->isWooCommerceActive() ) {
return true;
}
return $disabled;
}
The callback tests two conditions together. is_singular( 'product' ) checks the page context used by the example, while aioseo()->helpers->isWooCommerceActive() checks the WooCommerce state exposed in the snippet. When both conditions are true, the callback returns true. In every other case, it returns $disabled. The reference describes this example as preventing AIOSEO from outputting schema for WooCommerce products. The complete embedded code is available in AIOSEO's example snippet.
How should the filter be adapted?
Keep the hook name and the Boolean return value when adapting the documented pattern. The callback parameter receives the current $disabled state. A condition that should suppress AIOSEO schema can return true; a condition that should leave the current state unchanged can return $disabled, as in the published example.
The example's scope comes from its condition, rather than from a separate option. Its product test and WooCommerce activity test together define when the true return occurs. The AIOSEO page presents this as an example for WooCommerce products, so another scope requires a different condition in the callback.
Related terms
- Article structured data
- WebSite structured data
- How do I change page and article schema types in Yoast SEO?
- How do I set a default schema type in Rank Math?
FAQ
What hook name should you add?
Add aioseo_schema_disable. AIOSEO uses that hook name in the documented add_filter call.
What should the callback return to disable schema output?
Return the Boolean true for the condition that should suppress AIOSEO schema markup. The documented example returns $disabled when its product and WooCommerce condition is false.
Does the documented example disable schema on every page?
No. Its condition checks for a singular product and active WooCommerce, so the example's true return is tied to that context.
Sources
- AIOSEO, "aioseo_schema_disable", 14 August 2026
- AIOSEO embedded example via WPCode, "Disable Schema Output for WooCommerce products", 14 August 2026
Check how a page reads to answer engines. Open the GEO score analyzer