Filter schema.org markup

Need help with this?
Purchase All in One SEO Pack Pro to get dedicated support from us.

Buy Now

You can modify the schema.org markup to the html section with our aiosp_opengraph_attributes filter hook.

This could be useful if another plugin, such as WooCommerce, is outputting conflicting schema.org code on product pages.

Example:

add_filter( 'aiosp_opengraph_attributes', 'remove_schema_wc' );

function remove_schema_wc( $attributes ) {
if ( function_exists( ‘is_product’ ) && is_product() ) {

foreach ( $attributes as $key => $value ) {

if ( false !== strpos( $value, ‘itemtype’ ) || false !== strpos( $value, ‘itemscope’ ) ) {
unset( $attributes[ $key ] );
}
}

return $attributes;
}
}

[i]
[i]
Skip to toolbar