---
title: Filtro %%seopress_titles_post_thumbnail_url%% variable dinámica
url: "https://www.seopress.org/es/soporte/hooks/filtro-seopress_titles_post_thumbnail_url-variable-dinamica/"
lang: es
updated: 2026-10-16
hook_name: seopress_get_tag_post_thumbnail_url_value
required_version: 3.7.8
---

# Filtro %%seopress_titles_post_thumbnail_url%% variable dinámica

- **Hook name:** `seopress_get_tag_post_thumbnail_url_value`
- **Required version:** 3.7.8

```php
<?php
// seopress_titles_post_thumbnail_url is deprecated since 4.4.0, use seopress_get_tag_post_thumbnail_url_value instead.
add_filter( 'seopress_get_tag_post_thumbnail_url_value', 'sp_get_tag_post_thumbnail_url_value', 10, 2 );
function sp_get_tag_post_thumbnail_url_value( $value, $context ) {
	// $value: URL of the featured image (full size), empty outside single posts.
	if ( empty( $context['post'] ) ) {
		return $value;
	}

	$url = get_the_post_thumbnail_url( $context['post'], 'medium' );

	return $url ? $url : $value;
}
```

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



