Display the Last Updated Date of Your Posts in WordPress: A Comprehensive Guide

In the fast-paced world of content creation, keeping your audience informed about the freshness of your content is critical. Whether you’re running a blog, an e-commerce site, or a news platform, visitors want to know if the information they’re reading is up-to-date. One simple yet effective way to build trust and transparency is by displaying the last updated date of your WordPress posts.

Unlike the "published date" (which only shows when a post was first released), the last updated date reflects the most recent time you revised, edited, or added new information to a post. This small detail can significantly impact user experience, SEO, and credibility. For example, a reader researching "best SEO practices in 2024" is far more likely to engage with a post labeled "Updated on October 5, 2024" than one stuck with a 2021 published date—even if the 2021 post was recently updated but not labeled as such.

In this guide, we’ll walk you through every method to display the last updated date in WordPress, from beginner-friendly plugins to advanced code customizations. Whether you’re a non-technical blogger or a developer, you’ll find a solution that fits your needs. Let’s dive in!

Table of Contents#

  1. Why Display the Last Updated Date?
  2. Understanding Published vs. Last Updated Dates in WordPress
  3. Method 1: Using a WordPress Plugin (Beginner-Friendly)
  4. Method 2: Editing Theme Files (Manual Code Customization)
  5. Method 3: Using the Block Editor (Gutenberg)
  6. Method 4: Custom Code Snippets (Advanced)
  7. Advanced: Child Themes and Custom Post Types
  8. Troubleshooting Common Issues
  9. Best Practices for Displaying Last Updated Dates
  10. Conclusion
  11. References

Why Display the Last Updated Date?#

Before we jump into the "how," let’s clarify the "why." Displaying the last updated date offers several key benefits:

1. Builds Trust with Readers#

Visitors are more likely to trust content that clearly signals its freshness. For example, a medical blog post about "COVID-19 symptoms" with a 2020 published date but a 2024 updated date reassures readers that the information reflects the latest research.

2. Boosts SEO#

Search engines like Google prioritize up-to-date content. While Google hasn’t explicitly stated that the last updated date is a ranking factor, it does use "content freshness" as a signal for time-sensitive queries (e.g., news, trends, or product reviews). Displaying the updated date can help search engines recognize your content as current, potentially improving rankings.

3. Encourages Return Visits#

Regular readers may revisit posts they enjoyed if they see they’ve been updated. For example, a food blogger who updates a recipe with new tips will entice loyal followers to check back.

4. Transparency#

Hiding updates can make readers feel misled. If you revise a post to correct errors or add new data, labeling it as "updated" shows honesty and accountability.

Understanding Published vs. Last Updated Dates in WordPress#

By default, WordPress tracks two key dates for posts:

  • Published Date: The date and time the post was first made public (set manually when you click "Publish").
  • Last Modified Date: The date and time the post was last edited (automatically updated whenever you save or update the post).

You can view both dates in the WordPress admin:

  1. Open the post editor for any post.
  2. In the right-hand sidebar, scroll to the "Status & Visibility" section.
  3. Click "Published on [date]" to expand—you’ll see both the published date and the last modified date (labeled "Last modified").

WordPress post dates in the editor Note: Replace with a real screenshot link if publishing.

The challenge? Most WordPress themes only display the published date by default. To show the last updated date, you’ll need to customize your theme or use a plugin.

Method 1: Using a WordPress Plugin (Beginner-Friendly)#

If you’re not comfortable editing code, plugins are the easiest way to add a last updated date. Here are the top options:

WP Last Modified Info#

WP Last Modified Info is a popular, free plugin that automatically adds the last updated date to posts, pages, and custom post types. It also integrates with SEO plugins like Yoast and Rank Math to ensure search engines detect the updated date.

How to Set It Up:#

  1. Install the plugin:

    • Go to your WordPress dashboard → Plugins → Add New.
    • Search for "WP Last Modified Info" and click "Install Now," then "Activate."
  2. Configure settings:

    • Navigate to Settings → WP Last Modified Info.
    • Under the "General Settings" tab:
      • Check "Enable Last Modified Date" to activate the feature.
      • Choose where to display the date: "Before Content," "After Content," or "Both."
      • Select a date format (e.g., "F j, Y" for "October 5, 2024" or "M j, Y" for "Oct 5, 2024").
      • Add a label (e.g., "Updated on: " or "Last modified: ").
    • Under the "Post Types" tab, select which content types (posts, pages, custom post types) should display the date.
    • Save changes.
  3. Preview:
    Open any published post—you’ll now see the last updated date above or below the content.

Last Modified Timestamp#

For a lightweight alternative, try Last Modified Timestamp. This plugin adds the last updated date directly next to the published date in your theme’s existing date display (no extra settings required).

How to Set It Up:#

  1. Install and activate the plugin (via Plugins → Add New).
  2. No configuration needed! The plugin automatically modifies your theme’s date output to show:
    Published on [Published Date] • Updated on [Last Modified Date]

Note: This plugin works best with themes that use standard WordPress date functions (e.g., the_date() or get_the_date()).

Yoast SEO (Bonus: SEO Integration)#

If you already use Yoast SEO (the most popular SEO plugin), you can enable the last updated date in its settings. While Yoast doesn’t display the date on the frontend by default, it ensures search engines (like Google) see the modified date in your post’s metadata.

How to Enable:#

  1. Go to Yoast SEO → Settings → Content Types.
  2. For "Posts" (and other content types), scroll to "Advanced settings" and check "Show the last modified date in the snippet preview."
  3. Save changes.

Pro Tip: Combine Yoast with one of the plugins above to display the date on the frontend and ensure SEO visibility.

Method 2: Editing Theme Files (Manual Code Customization)#

For full control over the design and placement of the last updated date, you can edit your theme’s PHP files. Always back up your site first before making code changes!

Step 1: Locate Your Theme’s Template Files#

The last updated date is typically displayed in your theme’s "loop"—the code that generates post content. Common files to edit include:

  • single.php (for single post pages)
  • content.php (reusable template for post content, used by single.php, archive.php, etc.)
  • page.php (for pages, if you want to display the date there too)

To find the right file:

  1. Go to Appearance → Theme Editor (or use FTP to access wp-content/themes/[your-theme]/).
  2. On the right-hand side, look for files like single.php or content.php (the exact name varies by theme).

Warning: If you edit your parent theme directly, updates to the theme will overwrite your changes. Use a child theme instead (see the Advanced section for details).

Step 2: Add Code to Display the Last Updated Date#

Once you’ve opened the template file, search for the existing date code. It may look like this:

<p class="post-date">Published on <?php the_date(); ?></p>

To add the last updated date, replace or append this with:

<p class="post-date">
  <?php
  $published_date = get_the_date();
  $modified_date = get_the_modified_date();
  
  if ($modified_date !== $published_date) {
    echo 'Published on ' . $published_date . ' • Updated on ' . $modified_date;
  } else {
    echo 'Published on ' . $published_date;
  }
  ?>
</p>

What This Code Does:#

  • get_the_date(): Retrieves the published date.
  • get_the_modified_date(): Retrieves the last modified date.
  • The if statement checks if the post has been updated (i.e., if modified_date is different from published_date). If so, it shows both dates; otherwise, it only shows the published date.

Customize the Date Format:#

By default, get_the_modified_date() uses your site’s date format (set in Settings → General). To override this, pass a format string, e.g.:

get_the_modified_date('F j, Y'); // Output: "October 5, 2024"
get_the_modified_date('M j, Y'); // Output: "Oct 5, 2024"
get_the_modified_date('Y-m-d'); // Output: "2024-10-05" (ISO format)

Step 3: Style the Date with CSS#

To make the updated date stand out, add custom CSS. Go to Appearance → Customize → Additional CSS and paste:

.post-date {
  color: #666; /* Gray color for published date */
  font-size: 0.9em;
}
 
.post-date .updated {
  color: #e74c3c; /* Red color for updated date */
  font-style: italic;
}

Update your PHP code to include a class for the updated date:

if ($modified_date !== $published_date) {
  echo 'Published on ' . $published_date . ' • <span class="updated">Updated on ' . $modified_date . '</span>';
}

Now the updated date will appear in red and italicized, making it easy to spot!

Method 3: Using the Block Editor (Gutenberg)#

If you prefer not to edit theme files, you can add the last updated date directly in the Gutenberg block editor.

Using the "Post Date" Block#

Some WordPress themes (especially newer ones) support displaying the last modified date via the core "Post Date" block:

  1. Open the post editor for any post.
  2. Click the "+" icon to add a new block and search for "Post Date."
  3. Insert the block (e.g., at the top or bottom of your post).
  4. In the block settings (right sidebar), check if there’s an option to "Display last modified date" (varies by theme).

Note: Many themes still don’t support this feature. If you don’t see the option, try the custom HTML method below.

Using a Custom HTML Block with Shortcodes#

If the "Post Date" block doesn’t work, use a Custom HTML block with a PHP shortcode (we’ll create the shortcode in Method 4).

Step 1: Create a Shortcode (See Method 4 for details).#

Add this code to your child theme’s functions.php or a custom plugin:

function display_last_updated_date() {
  $modified_date = get_the_modified_date();
  $published_date = get_the_date();
  
  if ($modified_date !== $published_date) {
    return '<p class="updated-date">Updated on: ' . $modified_date . '</p>';
  }
  return ''; // Don't show if not updated
}
add_shortcode('last_updated_date', 'display_last_updated_date');

Step 2: Insert the Shortcode in a Post.#

  1. In the Gutenberg editor, add a Custom HTML block.
  2. Paste:
    [last_updated_date]
  3. Update the post. The shortcode will render as:
    <p class="updated-date">Updated on: October 5, 2024</p>

Method 4: Custom Code Snippets (Advanced)#

For developers, these code snippets offer flexibility to customize the last updated date display.

Add a Shortcode for Last Updated Date#

Shortcodes let you insert the last updated date anywhere in a post (e.g., in the introduction or conclusion). Use the snippet below in your child theme’s functions.php file:

// Add shortcode [last_updated_date]
function custom_last_updated_date_shortcode() {
  // Get dates
  $modified_time = get_the_modified_time('U');
  $published_time = get_the_time('U');
  
  // Only show if modified date is different from published date
  if ($modified_time !== $published_time) {
    $modified_date = get_the_modified_date('F j, Y'); // Custom format
    return '<div class="last-updated">🔄 Last updated on: ' . $modified_date . '</div>';
  }
  return ''; // Return empty if no updates
}
add_shortcode('last_updated_date', 'custom_last_updated_date_shortcode');

How to use: Insert [last_updated_date] into any post or page. You can customize the text (e.g., "Revised on") or date format (e.g., 'M j, Y' for "Oct 5, 2024").

Modify the Existing Date Display with Filters#

WordPress lets you "filter" existing functions to change their output. Use this snippet to replace the published date with the last updated date site-wide:

// Replace published date with last updated date in post meta
function replace_published_date_with_updated($the_date, $d, $post) {
  $modified_date = get_the_modified_date($d, $post);
  $published_date = get_the_date($d, $post);
  
  if ($modified_date !== $published_date) {
    return 'Updated on ' . $modified_date;
  }
  return $the_date; // Show published date if no updates
}
add_filter('get_the_date', 'replace_published_date_with_updated', 10, 3);
add_filter('the_date', 'replace_published_date_with_updated', 10, 3);

What this does: Everywhere your theme uses the_date() or get_the_date(), it will show "Updated on [date]" if the post has been modified.

Advanced: Child Themes and Custom Post Types#

Why Use a Child Theme?#

If you edit your parent theme’s files directly, theme updates will overwrite your changes. A child theme inherits all the functionality of the parent theme but lets you safely add custom code.

How to Create a Child Theme (Quick Version):#

  1. Create a child theme folder:

    • Via FTP, navigate to wp-content/themes/.
    • Create a new folder (e.g., twentytwentyfour-child).
  2. Add a style.css file to the child folder with this header:

    /*
    Theme Name: Twenty Twenty-Four Child
    Theme URI: https://example.com/
    Description: Child theme for Twenty Twenty-Four
    Author: Your Name
    Author URI: https://example.com/
    Template: twentytwentyfour
    Version: 1.0.0
    */

    Replace twentytwentyfour with your parent theme’s folder name (e.g., astra, generatepress).

  3. Activate the child theme:

    • Go to Appearance → Themes and activate your child theme.

Now you can edit the child theme’s functions.php or template files without losing changes on updates.

Displaying Last Updated Date on Custom Post Types#

If you use custom post types (e.g., "reviews," "products"), you’ll need to modify their template files (e.g., single-review.php) or use a plugin like WP Last Modified Info (which supports custom post types in its settings).

To manually add the date to a custom post type:

  1. Open the custom post type’s template file (e.g., single-review.php).
  2. Add the same PHP code from Method 2:
    <?php if (get_the_modified_date() !== get_the_date()) : ?>
      <p class="updated-date">Updated on <?php the_modified_date(); ?></p>
    <?php endif; ?>

Troubleshooting Common Issues#

Last Updated Date Not Showing Up#

  • Cache issue: Clear your site’s cache (via plugins like WP Rocket or Cloudflare) and browser cache.
  • Theme override: Some themes hardcode the date in header.php or footer.php—check all template files.
  • Plugin conflict: Deactivate other plugins (especially date-related ones) to see if there’s a conflict.
  • No updates yet: The date only shows if the post has been modified after publishing. Make a small edit and update the post to test.

Date Format Incorrect or Inconsistent#

  • Check site settings: Go to Settings → General and ensure the "Date Format" is consistent.
  • Custom format in code: If using get_the_modified_date(), specify a format (e.g., get_the_modified_date('F j, Y')).

Theme Overriding Changes#

  • Use a child theme: As mentioned earlier, parent theme updates will erase custom code. Switch to a child theme.
  • Check for theme hooks: Some themes use action hooks (e.g., do_action('after_post_date')) to add content. Use add_action() to inject the date instead of editing templates directly.

Best Practices for Displaying Last Updated Dates#

To maximize effectiveness, follow these tips:

  1. Be consistent: Use the same date format across all posts (e.g., "October 5, 2024" or "10/05/2024").
  2. Label clearly: Always prefix the updated date with "Updated on" or "Revised on" to avoid confusion.
  3. Place strategically: Display the date near the published date (e.g., "Published on [date] • Updated on [date]") or at the top of the post for visibility.
  4. Style to stand out: Use CSS to differentiate the updated date (e.g., a different color or italic text).
  5. Test on mobile: Ensure the date displays correctly on smartphones—avoid overlapping text.
  6. Backup first: Always backup your site before editing code or installing plugins.

Conclusion#

Displaying the last updated date is a simple yet powerful way to boost trust, SEO, and user engagement. Whether you use a plugin (like WP Last Modified Info), edit theme files, or code custom solutions, the methods in this guide will help you implement it in minutes.

Remember: Fresh content keeps readers coming back, and transparency builds loyalty. Start showing your last updated dates today—your audience (and search engines) will thank you!

References#