Home / Admin / Dynamically Add Article Schema to Posts
Duplicate Snippet

Embed Snippet on Your Site

Dynamically Add Article Schema to Posts

This filter can be used to Dynamically Add Article Schema to Posts.

40+
Code Preview
php
<?php
add_filter( 'aioseo_schema_graphs', 'aioseo_filter_schema_graphs' );
function aioseo_filter_schema_graphs( $graphs ) {
   if ( is_singular( 'post' ) && ! in_array( 'Article', $graphs, true ) ) {
      $graphs[] = 'Article';
   }
   return $graphs;
}

Comments

Add a Comment