Filtering the post types included in the Google News sitemap (Pro Feature)

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

Buy Now

The aioseop_news_sitemap_post_types filter hook (added in v3.4.0).


apply_filters( 'aioseo_news_sitemap_post_types', array('post') );

This filter can be used to filter the post types that are included in the Google News sitemap.

Parameters (1)

0. (array)
the post types that should be included. The default value is array('post').


The code example below can be used to include Pages in the Google News sitemap:

add_filter( 'aioseo_news_sitemap_post_types', 'aioseo_filter_post_types' );

function aioseo_filter_post_types( $post_types ) {
	array_push( $post_types, 'page' );
	return $post_types;

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

  • Was this helpful ?
  • YesNo