---
title: Add your custom global dynamic variables for title tag / meta description
url: "https://www.seopress.org/support/hooks/custom-global-dynamic-variables-title-tag/"
lang: en-US
updated: 2021-09-29
hook_name: seopress_titles_template_variables_array / seopress_titles_template_replace_array
required_version: 3.6.2
---

# Add your custom global dynamic variables for title tag / meta description

- **Hook name:** `seopress_titles_template_variables_array / seopress_titles_template_replace_array`
- **Required version:** 3.6.2

```php
function sp_titles_template_variables_array($array) {
	$array[] = '%%my-custom-global-variable%%';
	return $array;
}
add_filter('seopress_titles_template_variables_array', 'sp_titles_template_variables_array');

function sp_titles_template_replace_array($array) {
	//escape your values!
	$array[] = esc_attr(wp_strip_all_tags('my custom value'));
	return $array;
}
add_filter('seopress_titles_template_replace_array', 'sp_titles_template_replace_array');
```

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



