Home / Admin / Remove BreadcrumbList Schema
Duplicate Snippet

Embed Snippet on Your Site

Remove BreadcrumbList Schema

This snippet removes the BreadcrumbList Schema

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

Comments

Add a Comment