How to Display the Last Updated Date of an Article in WordPress (3 Different Methods)

Last updated on Mar 6, 2026

When looking for an article on the internet, some people prefer the ones that are regularly updated. This makes sense enough. If an article is regularly updated, it means that the writer (or anyone that is responsible for the article) cares about the relevance of the article.

If you have a WordPress site and regularly update the articles on your site to keep them relevant, you can display a little info about when did the last time the article is updated.

There are several ways to display the last updated date of an article in WordPress. The method can be vary depending on the theme you use.

Here are 3 different ways to display the last updated date of an article in WordPress.

Method 1: Edit the single.php File

You can use this method if you use a simple theme such as GoPress and default WordPress themes such as Twenty Nineteen, Twenty Seventeen, and Twenty Twenty. On those themes, the code to display the post meta (including the date) are on the single.php file.

To display the last modification date, add the following code right below the get_the_date(); code.

$u_time = get_the_time('U'); 
$u_modified_time = get_the_modified_time('U'); 
if ($u_modified_time >= $u_time + 86400) { 
echo " | Updated "; 
the_modified_time('F j, Y'); 
}

Here is the example of the code placement.

If you can't find the get_the_date(); code on the single.php file, you can try to find it on a file such as as post-meta.php file or other files with the similar names.

Method 2: Add a New Function to a Theme

If you have tried the method 1 above but didn't work, you can try to add a new function to your theme. To do so, login to your WordPress dashboard and go to Appearance -> Theme Editor (make sure to login as administrator).

Click the functions.php file on the right panel to edit it.

Add the following code on the last line on the functions.php file and click the Update File button to apply the new change.

function show_last_modified_date( $content ) {
$original_time = get_the_time('U');
$modified_time = get_the_modified_time('U');
if ($modified_time >= $original_time + 86400) {
$updated_time = get_the_modified_time('h:i a');
$updated_day = get_the_modified_time('F j, Y');
$modified_content .= '<p class="last-modified"><span style="background-color: #FFFF00"><i>Last updated:</i></span> '. $updated_day . '</p>';
}
$modified_content .= $content;
return $modified_content;
}
add_filter( 'the_content', 'show_last_modified_date' );

Method 3: Create a Custom Single Post Layout

If the first two methods above didn't work, you can create a custom single post layout to replace the default single post layout of your theme and add any element you like, including an element to display the last modification date of an article.

Don't worry, you can create a custom single post layout without coding.

Some page builder plugins, including Elementor, come with a theme builder feature that allows you to create a custom single post layout using a visual editor.

When creating a custom single post using Elementor, there is an option to display the last updated date of an article as you can see on the screenshot below.

In addition to Elementor, tagDiv Composer also allows you to create a custom single post layout on your WordPress site without coding.

When creating a custom single post using tagDiv Composer, you can also add an element that displays the last modification date of an article.

This page may contain affiliate links, which help support the project. Read our affiliate disclosure.

Editorial Staff

suggested posts

Cloudways vs SiteGround

Cloudways vs SiteGround

I used to use SiteGround and already moved all of my websites to Cloudways because SiteGround is getting…

Migrating a WordPress site to Cloudways

How to Migrate Your WordPress Site to a New Hosting without Downtime

If your website is growing bigger, maybe it is the time to move it to a more reliable hosting service. And...

Struggling to grow your website?

Learn the art of growing your website in 3 simple steps?