Home / Admin / Add Additional Custom Sitemap Index
Duplicate Snippet

Embed Snippet on Your Site

Add Additional Custom Sitemap Index

This filter can be used to add an Additional Custom Sitemap Index to the root index.

You can replace "https://somedomain.com/custom-sitemap.xml" with the Sitemap URL and 1000 with the URL count.

30+
Code Preview
php
<?php
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' ),
		'count'   => 1000
	];
	return $indexes;
}

Comments

Add a Comment