---
title: Filtrar the_content con variables dinámicas SEOPress
url: "https://www.seopress.org/es/soporte/hooks/filtrar-the_content-con-variables-dinamicas-seopress/"
lang: es
updated: 2021-09-30
hook_name: the_content
required_version: 1.0
---

# Filtrar the_content con variables dinámicas SEOPress

- **Hook name:** `the_content`
- **Required version:** 1.0

```php
function sp_filter_the_content_dynamic_variables( $content ) {	
	$variables = NULL;
	$variables = apply_filters('seopress_dyn_variables_fn', $variables);
	
	$seopress_titles_template_variables_array = $variables['seopress_titles_template_variables_array'];
	$seopress_titles_template_replace_array = $variables['seopress_titles_template_replace_array'];
	
	$content = str_replace($seopress_titles_template_variables_array, $seopress_titles_template_replace_array, $content);	
	
	return $content;
}
add_filter( 'the_content', 'sp_filter_the_content_dynamic_variables' );
```

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



