aioseo_sitemap_indexes

This filter can be used to control the indexes that AIOSEO includes in the general sitemap.

Parameters (1)

$indexes (multidimensional array)
The list of indexes. Each index has two properties:

  1. loc: the URL for the index;
  2. lastmod: datetime for when the index was last updated (formatted according to ISO 8061).

Example code snippet

In the example below, an extra sitemap index is added to the root index.

add_filter( 'aioseo_sitemap_indexes', 'aioseo_add_sitemap_index' );

function aioseo_add_sitemap_index( $indexes ) {
	$indexes[] = [
		'loc'     => 'https://somedomain.com/custom-sitemap.xml',
		'lastmod' => aioseo()->helpers->dateTimeToIso8601( '2021-09-08 12:02' )
	];
	return $indexes;
}

Changelog

VersionDescription
4.1.5Introduced.