[post_modified_date]

The shortcode displays the modified date of a post.


Product


Shortcode Attributes

  1. id – Post ID whose modified date you want to display.
    • Options: Any valid post ID.
  2. label – A label above the modified date.
    • Options: Any text value.
  3. date_format – Used to change the returned date format.

Shortcode Enclosed Content

Any content placed between [post_modified_date] and [/post_modified_date] will be used as a template, where {content} acts as a placeholder for the post modified date.


Example Usage

Example 1

[post_modified_date]

Results

This example returned the last modified date of the current post or page in the default date format specified in your WordPress settings.
If no ID is provided, the shortcode will automatically use the ID of the current post/page.
The {content} placeholder is case-sensitive and must be used exactly as shown.

Example 2

[post_modified_date id="123" date_format="F j, Y" label="Last Updated: "]

Results

<label>Last Updated: </label>
January 1, 2023
This example returned the published date for post ID 123 with specify a custom date format and a label before the date.

Example 3

[post_modified_date]Last modified on {content}[/post_modified_date]

Results

This example returned custom content, using {content} as a placeholder for the date:
Last modified on January 1, 2023