---
title: Filter the_content with SEOPress dynamic variables
url: "https://www.seopress.org/support/hooks/filter-the_content-with-seopress-dynamic-variables/"
lang: en-US
updated: 2021-09-30
hook_name: the_content
required_version: 1.0
---

# Filter the_content with SEOPress dynamic variables

- **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)



