---
title: Filtrar la consulta del mapa del sitio de índice de video
url: "https://www.seopress.org/es/soporte/hooks/filtrar-la-consulta-del-mapa-del-sitio-de-indice-de-video/"
lang: es
updated: 2021-09-30
hook_name: seopress_sitemaps_index_video_query
required_version: 4.1
---

# Filtrar la consulta del mapa del sitio de índice de video

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

```php
function sp_sitemaps_index_video_query($args, $cpt_key) { 
	//Default Query 
	//$args = [
	//	'post_type' => $cpt,
	//	'post_status' => 'publish',
	//	'ignore_sticky_posts' => true,
	//	'posts_per_page' => -1,
	//	'meta_query' => [
	//		'relation' => 'AND',
	//		[
	//			'relation' => 'OR',
	//			[
	//				'key' => '_seopress_robots_index',
	//				'value' => '',
	//				'compare' => 'NOT EXISTS'
	//			],
	//			[
	//				'key' => '_seopress_robots_index',
	//				'value' => 'yes',
	//				'compare' => '!='
	//			],
	//		],
	//		[
	//			'relation' => 'OR',
	//			[
	//				'key' => '_seopress_video_disabled',
	//				'value' => '',
	//				'compare' => 'NOT EXISTS'
	//			],
	//			[
	//				'key' => '_seopress_video_disabled',
	//				'value' => 'yes',
	//				'compare' => '!='
	//			],
	//		],
	//		[
	//			'key' => '_seopress_video',
	//			'compare' => 'EXISTS'
	//		]
	//	],
	//	'lang' => '',
	//	'has_password' => false,
	//	'fields' => 'ids',
	//];
	
	//Eg: include videos with post status = 'pending'
	$args['post_status'] = 'pending'; 

	return $args;
}
add_filter('seopress_sitemaps_index_video_query', 'sp_sitemaps_index_video_query');
```

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



