Title: post_thumbnail_url
Published: February 3, 2022
Last modified: May 20, 2026

---

# apply_filters( ‘post_thumbnail_url’, string|false $thumbnail_url, int|WP_Post|null $post, string|int[] $size )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#wp--skip-link--target)

Filters the post thumbnail URL.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#parameters)󠁿

 `$thumbnail_url`string|false

Post thumbnail URL or false if the post does not exist.

`$post`int|[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)
|null

Post ID or [WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)
object. Default is global `$post`.

`$size`string|int[]

Registered image size to retrieve the source for or a flat array of height and width
dimensions. Default `'post-thumbnail'`.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'post_thumbnail_url', $thumbnail_url, $post, $size );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/post-thumbnail-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/post-thumbnail-template.php#L269)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/post-thumbnail-template.php#L269-L269)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#related)󠁿

| Used by | Description | 
| [get_the_post_thumbnail_url()](https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/)`wp-includes/post-thumbnail-template.php` |

Returns the post thumbnail URL.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/post_thumbnail_url/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.9.0](https://developer.wordpress.org/reference/since/5.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fpost_thumbnail_url%2F)
before being able to contribute a note or feedback.