Title: get_lastpostmodified
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘get_lastpostmodified’, string|false $lastpostmodified, string $timezone, string $post_type )

## In this article

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

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

Filters the most recent time that a post on the site was modified.

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

 `$lastpostmodified`string|false

The most recent time that a post was modified, in ‘Y-m-d H:i:s’ format. False on
failure.

`$timezone`string

Location to use for getting the post modified date.
 See [get_lastpostdate()](https://developer.wordpress.org/reference/functions/get_lastpostdate/)
for accepted `$timezone` values.

More Arguments from get_lastpostdate( … $timezone )

The timezone for the timestamp. Accepts `'server'`, `'blog'`, or `'gmt'`.
 `'server'`
uses the server’s internal timezone. `'blog'` uses the `post_date` field, which 
proxies to the timezone set for the site. `'gmt'` uses the `post_date_gmt` field.
Default `'server'`.

`$post_type`string

The post type to check.

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

    ```php
    return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone, $post_type );
    ```

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

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

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

Gets the most recent time that a post on the site was modified.

  |

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

| Version | Description | 
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Added the `$post_type` parameter. | 
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |

## User Contributed Notes

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