Title: the_modified_date
Published: April 25, 2014
Last modified: August 20, 2026

---

# the_modified_date( string $format = '', string $before = '', string $after = '', bool $display = true ): string|null

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#user-contributed-notes)

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

Displays the date on which the post was last modified.

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

 `$format`stringoptional

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

Default:`''`

`$before`stringoptional

Output before the date.

Default:`''`

`$after`stringoptional

Output after the date.

Default:`''`

`$display`booloptional

Whether to echo the date or return it.

Default:`true`

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

 string|null String if retrieving.

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#more-information)󠁿

This tag works just like [the_modified_time()](https://codex.wordpress.org/Template_Tags/the_modified_time),
which also displays the time/date a post was last modified. This tag must be used
within [The Loop](https://codex.wordpress.org/The_Loop). If no format parameter 
is specified, the **Default date format** (please note that says Date format) setting
from [Administration](https://wordpress.org/support/article/administration-screens/)
> [Settings](https://wordpress.org/support/article/administration-screens/) > [General](https://wordpress.org/support/article/settings-general-screen/)
is used for the display format.

If the post or page is not yet modified, the modified date is the same as the creation
date.

Use [get_the_modified_date()](https://codex.wordpress.org/Function_Reference/get_the_modified_date)
to retrieve the value.

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

    ```php
    function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
    	$the_modified_date = $before . get_the_modified_date( $format ) . $after;

    	/**
    	 * Filters the date a post was last modified, for display.
    	 *
    	 * @since 2.1.0
    	 *
    	 * @param string $the_modified_date The last modified date.
    	 * @param string $format            PHP date format.
    	 * @param string $before            HTML output before the date.
    	 * @param string $after             HTML output after the date.
    	 */
    	$the_modified_date = apply_filters( 'the_modified_date', $the_modified_date, $format, $before, $after );

    	if ( $display ) {
    		echo $the_modified_date;
    	} else {
    		return $the_modified_date;
    	}
    }
    ```

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

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

 [apply_filters( ‘the_modified_date’, string $the_modified_date, string $format, string $before, string $after )](https://developer.wordpress.org/reference/hooks/the_modified_date/)

Filters the date a post was last modified, for display.

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

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

Retrieves the date on 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.

  |

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

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

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 5 content](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#comment-content-666)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_date/#comment-666)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-666)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-666)
 4.  **Default Usage**
      Displays the date the post was last modified, using the Default
     date format setting (e.g. F j, Y) from Administration > Settings > General.
 5.      ```php
         <p><?php printf( __( 'Last modified: %s', 'textdomain' ), get_the_modified_date() ); ?></p>
         ```
     
 6.  `Last modified: December 2, 2006`
 7.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%3Freplytocom%3D666%23feedback-editor-666)
 8.   [Skip to note 6 content](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#comment-content-667)
 9.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_date/#comment-667)
 10. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-667)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-667)
 11. **Date as Month Day, Year**
      Displays the last modified date in the date format‘
     F j, Y’ (ex: December 2, 2006).
 12.     ```php
         <div><?php printf( __( 'Last modified: %s', 'textdomain' ), get_the_modified_date( 'F j, Y' ) ); ?></div>
         ```
     
 13. `Last modified: December 2, 2006`
 14.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%3Freplytocom%3D667%23feedback-editor-667)
 15.  [Skip to note 7 content](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#comment-content-668)
 16.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_date/#comment-668)
 17. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-668)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-668)
 18. **Date and Time**
      Displays the date and time.
 19.     ```php
         <p><?php printf( __( 'Modified: %1$s at  %2$s', 'textdomain' ),
         	get_the_modified_date( 'F j, Y' ) ),
         	get_the_modified_date( 'g:i a' )
         ); ?></p>
         ```
     
 20. `Modified: December 2, 2006 at 10:36 pm`
 21.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%3Freplytocom%3D668%23feedback-editor-668)
 22.  [Skip to note 8 content](https://developer.wordpress.org/reference/functions/the_modified_date/?output_format=md#comment-content-669)
 23.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_date/#comment-669)
 24. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-669)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%23comment-669)
 25. **Date with superscript or subscript number suffixes**
      Displays the date with
     a superscript or subscript st, nd, rd or th after the day. Because characters 
     from the alphabet are used to represent the date format types, each of the HTML
     tag characters need to be escaped using a back slash. Superscript HTML tag is 
     <sup> and subscript is <sub>.
 26.     ```php
         <p><?php printf( __( 'Modified: %s', 'textdomain' ), get_the_modified_date('j\<\s\u\p\>S\<\/\s\u\p\> M Y') ); ?></p>
         ```
     
 27. Modified: 2nd Dec 2006
 28.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_date%2F%3Freplytocom%3D669%23feedback-editor-669)

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