Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Show Posts Date Modified WordPress Homepage

· 6 min read · Home Tech

In this article
  1. Why Display the Modified Date?
  2. How WordPress Stores Dates
  3. Method 1: Edit Your Theme’s Template Files
  4. Method 2: Use a Code Snippet (Recommended for Most Users)
  5. Method 3: Use a Plugin
  6. Common Problems and Troubleshooting
  7. Comparing Methods: Which One Should You Choose?
  8. Frequently Asked Questions

Yes, you can show the date a post was last modified on your WordPress homepage, and it takes only a small code snippet or a plugin. By default, WordPress displays the publish date, but a simple function added to your theme’s functions.php file (or a site-specific plugin) will let you display the modified date instead, or alongside the original.

Why Display the Modified Date?

Showing when a post was last updated is useful for both readers and site owners. For readers, it signals that the content is current and maintained, which builds trust. For site owners, especially those running news sites, tutorials, or blogs with evergreen content, it can reduce bounce rates because visitors see the information is fresh. Search engines also value updated content, so displaying the modified date can indirectly support your SEO efforts by making the update visible to users (though it is not a ranking factor by itself).

How WordPress Stores Dates

Every WordPress post has two date fields stored in the database: post_date (the original publish date) and post_modified (the last time the post was updated). The post_modified value is automatically updated whenever you edit and save a post, even if you only change the title or a minor detail. The default theme templates usually call the_date() or get_the_date() to display the publish date. To show the modified date, you need to use get_the_modified_date() instead.

Method 1: Edit Your Theme’s Template Files

If you are comfortable with a bit of code, this is the most direct method. You will need to edit the template file that displays post meta (often content.php, single.php, or archive.php).

  1. Open the relevant template file in your child theme (never edit the parent theme directly, as updates will overwrite your changes).
  2. Find the line that outputs the date, usually something like or a template tag like the_date().
  3. Replace it with to show only the modified date.
  4. If you want to show both dates, you can combine them, for example: Published: | Updated:
  5. Save the file and refresh your homepage to see the change.

This method gives you full control over the formatting and placement. However, it requires you to locate the correct template file, and the change will only affect the templates you edit. If you later switch themes, you will need to redo the edit.

A more flexible approach is to add a filter function to your theme’s functions.php file or a site-specific plugin. This method automatically replaces the displayed date on the homepage and archive pages without editing template files.

function wpb_last_modified_date( $the_date ) {
    if ( is_home() || is_archive() ) {
        return get_the_modified_date();
    }
    return $the_date;
}
add_filter( 'get_the_date', 'wpb_last_modified_date' );

This snippet checks if you are on the homepage or an archive page, and if so, returns the modified date instead of the original. You can adjust the conditions to target specific post types or pages. The advantage is that you do not need to touch template files, and it works across many themes. The downside is that it requires adding code, and if you are not careful, a syntax error could break your site.

Method 3: Use a Plugin

If you prefer not to touch code, several WordPress plugins can display the last modified date. For example, “WP Last Modified Info” or “Last Updated Shortcode” allow you to insert the modified date via a shortcode or automatically replace the date on posts. These plugins often provide options to show the date only on certain post types or to display a custom label like “Updated on”. The main advantage is ease of use and safety—no code to break. The downside is that plugins add extra weight to your site and may become outdated, so you should choose a well-maintained plugin with good reviews.

Common Problems and Troubleshooting

One common issue is that the modified date does not appear on the homepage even after adding the code. This usually happens because the homepage template uses a different function, such as get_the_time() or the_time(), which is not filtered by get_the_date. In that case, you need to target the correct filter or edit the template directly. Another issue is that the modified date shows the same as the publish date for posts that have never been updated—that is expected. Also, if you use a caching plugin, you may need to clear the cache to see the change. If you are using a page builder like Elementor or WPBakery, the date might be hardcoded in the widget, and you will need to adjust the widget settings or use a dynamic tag.

Comparing Methods: Which One Should You Choose?

  • Template edit – Best for precise placement, but requires coding and theme-specific knowledge.
  • Code snippet – Balanced approach; works across templates, but still requires adding code.
  • Plugin – Easiest for non-coders, but adds dependency and potential performance overhead.

For most users, the code snippet method is the best compromise. It is lightweight, reversible, and does not require hunting through template files. If you are not comfortable with code, a plugin is the safest choice.

Frequently Asked Questions

Will showing the modified date hurt my SEO?

No. Showing the modified date can actually help user engagement, which indirectly benefits SEO. Search engines do not penalize sites for displaying modified dates; they may even use the information to refresh their index. Just ensure the date is accurate—if you display a modified date but the content has not changed, it could be seen as misleading.

Can I show the modified date only on the homepage, not on single posts?

Yes. In the code snippet method, you can adjust the condition to target only the homepage, for example using is_home() alone. If you want it on single posts as well, you would include is_single() in the condition.

What if my theme uses a custom date function?

Some themes, especially those built with frameworks, use custom date functions. In that case, the standard filter might not work. You will need to locate the custom function in the theme’s files and modify it, or use a more specific filter like get_the_modified_date directly in the template.

Does the modified date update automatically when I edit a post?

Yes, WordPress automatically updates the post_modified field every time you save a post, including autosaves. However, if you only change the excerpt or a custom field, it still counts as an update. If you want to manually set a different modified date, you can use a plugin or edit the post’s date in the editor.

Can I display the modified date in a different format?

Yes. The get_the_modified_date() function accepts a format parameter, like get_the_modified_date( 'F j, Y' ) to show “January 5, 2025”. You can use any PHP date format string.

Will this work with caching plugins?

Yes, but you need to clear the cache after making changes. Caching plugins serve static HTML, so your changes will not appear until the cache is purged. Some caching plugins also have options to exclude certain pages from caching, but it is simpler to just clear the cache after editing.