---
title: Filtrar consulta de mapa de sitio XML de índice de tipo de publicación personalizada
url: "https://www.seopress.org/es/soporte/hooks/filtrar-consulta-de-mapa-de-sitio-xml-de-indice-de-tipo-de-publicacion-personalizada/"
lang: es
updated: 2021-09-30
hook_name: seopress_sitemaps_index_post_types_query
required_version: 4.1
---

# Filtrar consulta de mapa de sitio XML de índice de tipo de publicación personalizada

- **Hook name:** `seopress_sitemaps_index_post_types_query`
- **Required version:** 4.1

```php
<?php
add_filter( 'seopress_sitemaps_index_post_types_query', 'sp_sitemaps_index_post_types_query', 10, 2 );
function sp_sitemaps_index_post_types_query( $args, $cpt_key ) {
	// Default arguments:
	// $args = array(
	//     'posts_per_page' => -1,
	//     'post_type'      => $cpt_key,
	//     'post_status'    => 'publish',
	//     'fields'         => 'ids',
	//     'lang'           => '',
	//     'has_password'   => false,
	// );

	// Do your stuff here
	return $args;
}
```

Source: [https://gist.github.com/wp-seopress/b14707d25e3604c4d22528b42b16b799](https://gist.github.com/wp-seopress/b14707d25e3604c4d22528b42b16b799)



