---
title: Filter the list of predefined dynamic variables for automatic schemas
url: "https://www.seopress.org/support/hooks/filter-predefined-dynamic-variables-for-automatic-schemas/"
lang: en-US
updated: 2021-09-30
hook_name: seopress_schemas_mapping_select, seopress_schemas_dyn_variables, seopress_schemas_dyn_variables_replace
required_version: 4.7
---

# Filter the list of predefined dynamic variables for automatic schemas

- **Hook name:** `seopress_schemas_mapping_select, seopress_schemas_dyn_variables, seopress_schemas_dyn_variables_replace`
- **Required version:** 4.7

```php
add_filter('seopress_schemas_mapping_select', 'sp_schemas_mapping_select');
function sp_schemas_mapping_select($select) {
	//Add the new group option + option to the list
	$select['Custom variables'] = [
		'my_custom_var_key' => __('My super custom var', 'wp-seopress-pro'),
	];

	return $select;
}
add_filter('seopress_schemas_dyn_variables', 'sp_schemas_dyn_variables');
function sp_schemas_dyn_variables($vars) {
	//add the variable key
	$vars[] = 'my_custom_var_key';
	
	return $vars;
}
add_filter('seopress_schemas_dyn_variables_replace', 'sp_schemas_dyn_variables_replace');
function sp_schemas_dyn_variables_replace($values) {
	//replace the new key by our own value
	//eg: author last name
	$values[] = get_the_author_meta('last_name');

	return $values;
}
```

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


[![seopress custom variables automatic schemas](https://www.seopress.org/wp-content/uploads/2021/05/seopress-custom-variables-automatic-schemas.jpg)](https://www.seopress.org/wp-content/uploads/2021/05/seopress-custom-variables-automatic-schemas.jpg)

*Add custom dynamic variables to automatic schemas list*
