aioseo_schema_output

Purpose

This filter can be used to filter the JSON schema that All in One SEO outputs.

Arguments (1)

  1. $graphs (array) – The graphs with their properties as multidimensional arrays.

Example code snippet

The code snippet below is just an example of how this filter can be used. In the example below, the BreadcrumbList graph is removed from the output.

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 ] );
      }
   }
   return $graphs;
}