---
title: Filtra la solicitud para generar un metatítulo con IA
url: "https://www.seopress.org/es/soporte/hooks/filtra-la-solicitud-para-generar-un-metatitulo-con-ia/"
lang: es
updated: 2026-03-10
hook_name: seopress_ai_{provider}_meta_title
required_version: 6.3
---

# Filtra la solicitud para generar un metatítulo con IA

- **Hook name:** `seopress_ai_{provider}_meta_title`
- **Required version:** 6.3

```php
add_filter('seopress_ai_openai_meta_title', 'sp_ai_openai_meta_title', 10, 2);
function sp_ai_openai_meta_title($prompt, $post_id) {
	//$content = get_post_field('post_content', $post_id);
	//$content = esc_attr(stripslashes_deep(wp_filter_nohtml_kses(wp_strip_all_tags(strip_shortcodes($content)))));
	//$content = wp_trim_words( $content, 500 );

	$language = 'fr_FR'; //example with French locale, replace with your own language code
	
	$prompt = 'Generate, in this language ' . $language . ', an engaging SEO title metadata in one sentence of sixty characters maximum for this article: ' . $content;
	return $prompt;
}
```

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


 

Reemplazar `{provider}` por el nombre del proveedor de IA:

- openai
- deepseek
- gemini
- mistral
- claude
