Home / Admin / Remove the Article schema from Posts
Duplicate Snippet

Embed Snippet on Your Site

Remove the Article schema from Posts

This snippet removes the Article schema from Posts

<10
Code Preview
php
<?php
add_filter( 'aioseo_schema_output', 'aioseo_filter_schema_output' );
function aioseo_filter_schema_output( $graphs ) {
	if ( is_singular( 'post' ) ) {
 	   foreach ( $graphs as $index => $graph ) {
			if ( 'Article' === $graph['@type'] ) {
				unset( $graphs[ $index ] );
			}
		}
	}
	return $graphs;
}

Comments

Add a Comment