Jetpack 101

How to Display the “Last Updated” Date on WordPress Posts

Woman working on her laptop in a warmly lit cafe.

Freshening up online content is a great way to show readers (and search engines) that you’re actively maintaining your site. It builds trust that the information is accurate and up to date. By default, WordPress displays the original publication date, but not when you last updated the content.

In other words, a three-year-old post about social media trends might appear outdated at first glance, even if you revised it last week. Search engines also consider content freshness when ranking pages, so not displaying updates could negatively affect SEO.

The fix is straightforward: add a “last updated” date to WordPress posts manually with code or by using a plugin. Let’s go over how to set it up.

Why showing last updated dates matters

Updated content often performs better in search results. Google aims to give users the latest information available, so when you refresh an old post and display the update date, you signal to search engines that the content is fresh.

Readers value transparency, too. They want to know whether the tutorial they’re following reflects the latest information. A visible “last updated” date helps them decide whether to trust what they’re reading.

Many well-established websites use this approach. News outlets, tech blogs, and educational resources routinely display when articles were last altered. It’s become an expected feature that strengthens a source’s credibility.

Method 1: Use a WordPress plugin to display the last updated date

Plugins offer a quick way to add new functionality to your site without writing code or editing WordPress files directly.

Several plugins can display a “last updated” date on your posts, including:

WP Last Modified Info

WP Last Modified Info is a free plugin that adds “last updated” dates without coding. It offers display options (before or after the content) and lets you customize the accompanying text. It also automatically adds “dateModified” schema markup to your posts for better SEO.

Post Updated Date

Post Updated Date is another plugin that focuses entirely on displaying update dates. You can control exactly where the “last updated” date appears, customize its style, and exclude certain post types. It also includes schema markup support to help search engines better understand your content.

Easy Table of Contents

Easy Table of Contents adds a navigation table to long posts and includes an option to display and customize a “last updated” date. The plugin offers flexible placement options, so you can decide exactly where the date appears in your content. It’s a good choice if you want multiple features in one plugin. 

The plugin you choose ultimately depends on your needs — whether you want a lightweight tool that does just one thing or a multipurpose plugin with extra features.

If you prefer not to rely on plugins, the next method shows you how to add a “last updated” date manually. Just keep in mind that it’s a bit more technical and requires editing your site’s code.

Method 2: Add code to your theme files

This method gives you complete control over how and where the “last updated” date appears. To keep your edits safe, always back up your website first and use a child theme whenever possible.

Benefits of child themes

Child themes protect your customizations from being overwritten during updates. Plus, they make managing different versions of your modifications easier, so if something goes wrong, you can quickly revert to the parent theme.

Locating the right template file

For classic themes, post content usually lives in single.php or content-single.php. Some themes use index.php for all post types. To access these files, navigate to Appearance →  Theme Editor in the WordPress dashboard.

Look for the section that displays post metadata, often near the post title or after the content. You’ll see code that displays the publication date, author name, and categories.

If your site uses a block theme, you won’t see single.php or content-single.php in the Theme File Editor. Block themes store templates differently, and the editor doesn’t allow for direct PHP edits. To safely add a “last updated” date, use a child theme or a code snippet plugin instead.

Adding the basic code

Insert this PHP code where you want the last updated date to appear:

<?php

$published_date = get_the_date();

$modified_date = get_the_modified_date();

if ($modified_date !== $published_date) {

    echo '<p class="last-updated">Last updated: ' . $modified_date . '</p>';

}

?>

This code compares the publication date with the last modified date. If you haven’t updated the post since it was first published, nothing displays. If you update the post, the code outputs a “last updated” message showing the most recent modification date.

Customizing the display format

The default date format comes from your WordPress settings, which may display numbers (e.g., 1/15/25) or a written-out style (e.g., January 15, 2025). Using other PHP commands, you can change the format to show dates the way you prefer.

<?php

$published_date = get_the_date('Y-m-d');

$modified_date = get_the_modified_date('F j, Y');

if ($modified_date !== $published_date) {

    echo '<div class="update-notice">';

    echo '<strong>Updated:</strong> ' . $modified_date;

    echo '</div>';

}

?>

In this example, ‘F j, Y’ formats dates like “January 15, 2025.“ Adjust the format string to match your site’s style, and see the PHP date format guide for a full list of options.

Method 3: Add it to your functions.php file

The functions.php file lets you add custom PHP instructions that apply to your whole theme. This method is ideal if you want the “last updated” date to appear across your site without editing multiple template files.

If you’re using a classic theme, you can find functions.php in the Theme Editor.

For block themes, this file isn’t directly accessible. Instead, you can use a plugin like Code Snippets to add the same functionality from your WordPress dashboard.

Creating a custom function

Open your theme’s functions.php file (or your Code Snippets plugin editor) and paste in the following code. Adding a short comment above the code (preceding it with //) will help future editors understand what it does and why it’s there.

// Add "Last Updated" date before post content if newer than publish date

function add_last_updated_date($content) {

    if (is_single() && in_the_loop() && is_main_query()) {

        $published_date = get_the_date('Y-m-d');

        $modified_date = get_the_modified_date('Y-m-d');

        if ($modified_date > $published_date) {

            $updated_text  = '<div class="last-updated-wrapper">';

            $updated_text .= '<p class="last-updated-date">';

            $updated_text .= 'This post was last updated on ' . esc_html(get_the_modified_date('F j, Y'));

            $updated_text .= '</p></div>';

            $content = $updated_text . $content;

        }

    }

    return $content;

}

add_filter('the_content', 'add_last_updated_date');

Once saved, your “last updated” date will appear at the top of any post you update after it’s first published.

Advanced customization options

As mentioned above, the functions.php file affects your entire theme. Its versatility also lets you add instructions to modify how your “last updated” date behaves.

Below are optional tweaks for readers comfortable with PHP. Once you have the basic “last updated” dates working, you can use these to further customize how they appear on your site.

Filtering by post type

If you only want to display last updated dates for certain content types, modify the function to target specific post types:

function add_last_updated_date($content) {

    $allowed_post_types = array('post', 'tutorial', 'guide');

    if (is_single() && in_the_loop() && is_main_query() && in_array(get_post_type(), $allowed_post_types)) {

        // Rest of the code stays the same

    }

    return $content;

}

This function adds update dates only to regular posts and the custom post types named tutorial and guide.

Adding time since last update

Instead of showing the exact date, some site owners prefer to display how long it’s been since they’ve updated their posts.

function time_since_updated() {

    $modified_time = get_the_modified_time('U');

    $current_time = current_time('timestamp');

    $time_diff = human_time_diff($modified_time, $current_time);

    return 'Updated ' . $time_diff . ' ago';

}

This creates messages like “Updated 3 days ago” or “Updated 2 weeks ago,” giving readers a quick sense of recency.

Conditional display based on age

This approach displays the update notice for posts that are a certain number of days old, keeping newer content clean and uncluttered.

$published_timestamp = get_the_date('U');

$days_old = (current_time('timestamp') - $published_timestamp) / DAY_IN_SECONDS;

if ($days_old > 30 && $modified_date !== $published_date) {

    // Show the last updated date

}

This code only displays update dates for posts older than 30 days that have received updates.

Adding structured data

Structured data helps search engines understand your content more accurately than plain text. Adding the appropriate markup lets search engines recognize your update dates.

echo '<div class="last-updated" itemprop="dateModified" content="' . get_the_modified_date('c') . '">';

echo 'Last updated: ' . get_the_modified_date('F j, Y');

echo '</div>';

Using the ‘c’ format creates ISO 8601 dates, which search engines prefer for structured data.

Testing your implementation

Before celebrating your new “last updated” date additions, take a few minutes to ensure everything works correctly. This step helps prevent errors from going live and keeps your site looking polished.

Update an existing post and confirm that the last updated date appears correctly. Check this change on different devices to ensure the display looks good on mobile phones and tablets. Sometimes CSS that looks fine on a desktop can create issues on smaller screens.

It’s also a good idea to check your site’s load speed. Poorly written code can affect page load times, so use tools like GTmetrix or Google PageSpeed Insights to monitor performance.

Man working at his desk with multiple trying to solve some sort of problem.
AI

The most powerful AI tool for WordPress

Turn your ideas into ready-to-publish content at lightspeed.

Elevate your content

Troubleshooting common issues

Even with everything set up correctly, small hiccups can happen. The good news is that most issues with last updated dates are easy to fix.

1. Update date not showing

If the last updated date doesn’t appear, be sure you’ve modified your post’s content. WordPress only updates the modification date when you save actual changes, not when you simply open and save without editing.

Also, clear any caching plugins on your site, as cached versions might still show the old layout without your new last updated date feature.

Some theme updates can override date formats in their code. If that happens, review the files you edited to ensure your changes are still in place, and confirm you’re using a child theme to keep customizations safe.

2. Wrong date format

Date format issues often come from your timezone settings. To check, navigate to Settings → General in your WordPress dashboard and make sure the timezone matches your location.

3. Styling problems

CSS conflicts can prevent your last updated date from displaying correctly. Use your browser’s developer tools to inspect the HTML and see whether your styles apply.

If other styles override yours, try adding !important to your CSS rules — this forces your styles to take priority.

Strategy first: When to show updated vs. published dates

Before implementing any code, it’s crucial to have a strategy. The date you display sends a signal to both users and search engines.

Show “Last Updated” for: Evergreen content, tutorials, guides, and “best of” lists where freshness is critical for accuracy and trust. This is the focus of this guide.

Show “Published On” for: News articles, press releases, and time-sensitive announcements where the original publication context is most important.

Show Both: For cornerstone articles that are regularly updated, showing both can provide full transparency. For example: “Originally Published: January 5, 2024 | Last Updated: October 31, 2025”

Crucial for SEO: Adding dateModified schema

Displaying the date is for users, but adding schema data is for search engines. It tells Google explicitly when the content was published and modified. Even if you use a plugin, you can verify it’s working by checking your page with Google’s Rich Results Test.

Here is an example of the ideal JSON-LD schema to include in your post’s <head> section:

<script type=”application/ld+json”>

{

  “@context”: “https://schema.org&#8221;,

  “@type”: “BlogPosting”,

  “headline”: “Your Post Title”,

  “datePublished”: “2024-01-15T08:00:00+00:00”,

  “dateModified”: “2025-10-31T14:30:00+00:00”,

  “author”: {

    “@type”: “Person”,

    “name”: “Author Name”

  }

}

<\/script>

Key takeaways for content freshness

Displaying the “last updated” date is more than a technical task—it’s a signal of trust and quality.

To recap:

  • For Users: It shows your content is current and reliable.
  • For SEO: It signals content freshness to Google, which can positively impact rankings.
  • Implementation: Beginners should use a plugin like WP Last Modified Info, while developers can use a manual code method for more control.
  • Don’t Forget Schema: Ensure dateModified schema is correctly implemented to communicate the update to search engines.

A smart way to save time with Jetpack AI Assistant

When refreshing older content, use a tool like Jetpack AI Assistant to help you quickly rewrite paragraphs for clarity or expand on points, saving you time while you focus on factual accuracy. Jetpack AI Assistant makes this process easier right from your WordPress editor.

Jetpack website homepage hero section with title, subtitle, paragraph copy, image, and 'elevate your content' button.

Use the AI assistant to draft posts, fix grammar errors, or rewrite old sections. It helps you organize your ideas faster so you can focus on ensuring the accuracy of your content.

If you need to update a post with new information, the AI assistant can help you get started. Then, you can edit the text to match your voice. 

Learn more about Jetpack AI Assistant and discover how it can save you time while keeping your content up to date.

Frequently asked questions

Will changing the last updated date affect my post’s URL or permalink?

No, displaying the last updated date will not change your post’s URL. The permalink, which is the permanent web address of your post, is set when you first publish it and is independent of the modification date.

The last updated date is a separate piece of information (metadata) associated with the post. You can freely update your content and display the new date without any risk of breaking existing links or losing the SEO value tied to your original URL. This separation ensures stability for your site’s structure while allowing you to signal content freshness.

Can I display both the published and last updated dates on the same post?

Yes, you can display both dates, and it is a good practice for transparency, especially for cornerstone content that is updated regularly. To do this, you would modify your theme’s template file to include both PHP functions: the_time() for the publication date and the_modified_time() for the update date.

You can format it clearly for readers. For example: “Published on: January 15, 2024 | Last Updated: October 31, 2025”. This approach gives readers full context on the content’s history and its recent relevance, which builds trust and authority.

What is the difference between datePublished and dateModified in schema markup?

datePublished and dateModified are schema properties that you communicate directly to search engines, not to users. datePublished tells search engines the exact date and time the article was first made live. dateModified tells them the date and time the article last underwent a significant revision.

Including both in your page’s JSON-LD schema is a best practice. It gives search engines like Google precise information about your content’s lifecycle, helping them understand its freshness and relevance for search queries where timeliness is important. This is separate from the date displayed on the page itself.

How do I add the last updated date to a WordPress block theme?

In a block theme that uses the Full Site Editor, you add the last updated date by editing the Single Post template. From your WordPress dashboard, navigate to Appearance > Editor. Select the “Single” post template.

Here, you will see a Post Date block. You can click on this block and find a setting to display the last modified date instead of the original publication date. You can also add a new Post Date block and configure it to show the modified date. This block-based approach avoids the need to directly edit PHP code.

Should I show the last updated date on all types of content?

No, it is a strategic decision that depends on the content type. Displaying the last updated date is most beneficial for evergreen content where accuracy and currency are critical. This includes tutorials, how-to guides, “best of” lists, and detailed resource pages.

For content where the original publication date provides essential context, such as news articles, press releases, or event announcements, you can stick with the original publish date. Showing an updated date on a news article from three years ago could confuse readers and diminish the article’s historical context.

Can displaying the last updated date improve my SEO rankings?

Displaying the last updated date can indirectly improve your SEO rankings. While the date itself is not a direct ranking factor, it influences user behavior and signals content freshness to Google.

When users see a recent date on an article, they are more likely to trust it and click on it in search results, which can improve your click-through rate (CTR). A higher CTR and positive engagement signals (like lower bounce rates and longer dwell time) tell Google that your page is a helpful result. This, combined with the dateModified schema, helps Google see your content as fresh and relevant.

This entry was posted in WordPress Tutorials. Bookmark the permalink.
WordPress Tutorials

Jen Swisher profile

Jen Swisher

Jen is a Customer Experience Specialist for Jetpack. She has been working with WordPress and Jetpack for over a decade. Before starting at Automattic, Jen helped small businesses, local non-profits, and Fortune 50 companies create engaging web experiences for their customers. She is passionate about teaching others how to create on the web without fear.

AI

The most powerful AI tool for WordPress

Turn your ideas into ready-to-publish content at lightspeed.

Elevate your content

Have a question?

Comments are closed for this article, but we're still here to help! Visit the support forum and we'll be happy to answer any questions.

View support forum