---
title: Filter %%_cf_your_custom_field_name%% dynamic variable
url: "https://www.seopress.org/support/hooks/filter-_cf_your_custom_field_name-dynamic-variable/"
lang: en-US
updated: 2023-05-29
hook_name: seopress_titles_custom_field
required_version: 6.7
---

# Filter %%_cf_your_custom_field_name%% dynamic variable

- **Hook name:** `seopress_titles_custom_field`
- **Required version:** 6.7

```php
add_filter('seopress_titles_custom_field', 'sp_titles_custom_field', 10, 2);
function sp_titles_custom_field($custom_field_value, $custom_field_key) {
	//do your stuff
	//$custom_field_value = esc_attr(get_post_meta(get_the_ID(), $custom_field_key, true));

	return $custom_field_value;
}
```

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



