Change schema type

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

Buy Now

By default, All in One SEO Pack outputs the most appropriate Schema type for Posts and Pages.  For Posts, the type is Article.  For Pages, the type is WebPage.

This filter enables users to change the default type for Posts from Article to a more appropriate type based on their website, i.e. NewsArticle or BlogPosting.

Users should exercise caution when using this filter, because changing the type to something that is not appropriate could result in errors.  Always test using Google’s Structure Data Testing Tool.

function aioseop_change_schema_article_type( $data ) {
     $data['@type'] = 'NewsArticle';
     return $data;
}
add_filter( 'aioseop_schema_class_data_AIOSEOP_Graph_Article', 'aioseop_change_schema_article_type' );

For instructions on how to use this code, please refer to our FAQ here.

  • Was this helpful ?
  • YesNo
[i]
[i]
Skip to toolbar