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

---

# get_the_modified_date( string $format, int|WP_Post $post = null ): string|int|false

## In this article

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

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

Retrieves the date on which the post was last modified.

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

 `$format`stringoptional

PHP date format. Defaults to the `'date_format'` option.

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

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

Default:`null`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_the_modified_date/?output_format=md#return)󠁿

 string|int|false Date the current post was modified. False on failure.

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

    ```php
    function get_the_modified_date( $format = '', $post = null ) {
    	$post = get_post( $post );

    	if ( ! $post ) {
    		// For backward compatibility, failures go through the filter below.
    		$the_time = false;
    	} else {
    		$_format = ! empty( $format ) ? $format : get_option( 'date_format' );

    		$the_time = get_post_modified_time( $_format, false, $post, true );
    	}

    	/**
    	 * Filters the date a post was last modified.
    	 *
    	 * @since 2.1.0
    	 * @since 4.6.0 Added the `$post` parameter.
    	 *
    	 * @param string|int|false $the_time The formatted date or false if no post is found.
    	 * @param string           $format   PHP date format.
    	 * @param WP_Post|null     $post     WP_Post object or null if no post is found.
    	 */
    	return apply_filters( 'get_the_modified_date', $the_time, $format, $post );
    }
    ```

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

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/get_the_modified_date/?output_format=md#hooks)󠁿

 [apply_filters( ‘get_the_modified_date’, string|int|false $the_time, string $format, WP_Post|null $post )](https://developer.wordpress.org/reference/hooks/get_the_modified_date/)

Filters the date a post was last modified.

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

| Uses | Description | 
| [get_post_modified_time()](https://developer.wordpress.org/reference/functions/get_post_modified_time/)`wp-includes/general-template.php` |

Retrieves the time at which the post was last modified.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

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

Retrieves post data given a post ID or post object.

  |

[Show 2 more](https://developer.wordpress.org/reference/functions/get_the_modified_date/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/get_the_modified_date/?output_format=md#)

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

Gets value for Post Data source.

  | 
| [the_modified_date()](https://developer.wordpress.org/reference/functions/the_modified_date/)`wp-includes/general-template.php` |

Displays the date on which the post was last modified.

  |

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

| Version | Description | 
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$post` parameter. | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |

## User Contributed Notes

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