How to show the last updated Date in WordPress Posts and Pages

Jun 21, 2022
Little figures showing last updated on posts and pages

So users will see the most recent date alongside the "Published" date. Alternatively, you can replace the Published date altogether.    

Where To View the Published dates and the Dates Last Updated

An example of the published date on an old post.
The example below shows the posted date of an old blog post.
The Twenty Twenty theme offers a unique published date format.
Twenty Twenty is a unique theme. Twenty Twenty theme offers a distinctive format for publishing dates.
The date on this theme is displayed below the content.
The date on this theme is displayed below the content.

It is also possible to find the Date of publication on the backend, by going to the Date column on your Posts list.

The Date column shows published dates in the WordPress dashboard.
The Date column shows date dates that have been published on WordPress's dashboard. WordPress dashboard.

WordPress shows the posted date in the Post editor.

The Published date is the only date shown when editing a post in WordPress
The published date is the only time a date is displayed when editing a post in WordPress.

In this piece in this article, we'll explain the benefits of showing an "Last Updated" date instead of the date of publication. In addition, we will guide you through different methods to show the most recent date, while also demonstrating how to identify when a website was last updated.

Keep reading to learn all about it!

Benefits of Displaying the "Last Revised" Date on Your Website

These are the main advantages that display the "Last Updated" date on your pages as well as on your posts.

  • The most current date is more accurate than the date of publication, and this indicates that your content is probably more refreshed when compared to something that was published a while ago.
  • The users will see it's an updated article and don't believe it's an older one. It's possibly increasing rate of clicks and overall time users spend reading.
  • Your "Last updated" date gives you the chance to stand out as search engines will display those dates in the results and your results get displayed alongside listings on other websites.
  • The search engines are known to search for your website more often when the content (and the date) is updated. There is no hard and fast rule, but search engines are known to log sites with constantly updating content, crawling them more frequently.
  • because the entirety of your website benefits from the posts you have updated.
  • It provides you with a visual excuse/reminder to update your website, as you could notice an older date and realize that a refresh is required.
  • Certain newspapers (like newspaper websites) require an "Last Updated" date in order to ensure that the content that has updates and corrections is displayed at the top of the feed for that site. This is so users don't miss those news updates.

How Do I Display the Latest Day of Update in WordPress

As a by default WordPress does not display the latest date that was updated for the new or revised content, but rather the published date. This date is still published regardless of whether it's a few years later and multiple updates have been made to the post.

If you're unable to include the date of last update in your WordPress Customizer, use these ways to include it:

  1. Editing by editing the functions.php file and By editing CSS
  2. Through modifying the code in the template of your website
  3. By using an extension

View the three methods below to figure out the right course of action in your particular situation.

Method 1: Modify functions.php and CSS within your theme

The options all use the same CSS code. We'll offer you a couple of lines of code you can add and help you include it in the functions.php file. If you're using an individual theme, or site-specific plugin, simply take the same code and alter the files.

Open the functions.php file
Navigate to your functions.php file.
function show_last_updated( $content ) 
 $u_time = get_the_time('U');
 $u_modified_time = get_the_modified_time('U');
 if ($u_modified_time >= $u_time + 86400) custom_content .= $contentreturn $custom_content;
 
filter to add(  the_content'),'show_last_updated' );

Download and save the file on your server. As a result, the last updated date appears right before your post's content. The code initially checks to see if the posted date and the last updated date coincide.

If they're the same then you'll get the publication date displayed on its own. If they're not the date that was last changed will be displayed along with the published date.

Frontend view of the last updated date
Frontend view of the last update date.

What can you do to change the style of your new Last Updated Date

.last-updated-date 
 font-size: large;
 font-family: monospace;
 text-transform: uppercase;
 color: white;
 background-color: black;
 

NOTE: It's entirely possible to alter the CSS properties and values depending on what you require; these are only examples.

Add the CSS code into the box when you go to Appearance > Customize > Additional CSS within WordPress. This enables to use the CSS to be applied across the entire site instead of just on one page or post.

Add CSS code for styling
Add CSS code for styling.
Frontend view after CSS styling
Frontend view after CSS styling.

How To Remove the Last Updated Date from Pages and other content that is not posted

Some sites don't need a last updated date on pages like a Privacy Policy
Some sites don't need an updated last date for pages like a Privacy Policy.

Therefore, you must go back to the theme's functions.php file and include this in between the numbers 86400 between 86400 and ).

&& is_singular('post')

Like this:

function show_last_updated( $content ) 
include_filter( 'the_content', 'show_last_updated' );
The date gets stripped from all pages, but remains on posts
The date gets stripped off all webpages, however it is still visible on the post.

Take out the published date and show only the last Date that was Updated.

It's not uncommon for the public date to stick around even after you've implemented the code that adds the last updated date. Certain themes take it off However, it's not that common. Problem is, now there are two dates displayed in your WordPress posts: the published date, and the latest updated date.

While some circumstances may render this acceptable, two dates are likely to cause confusion for readers. So, you might want to cover the publication date however, you should keep in mind the most recently updated date.

To remove the date that was published, but retain the last updated date (previously created using the techniques above) To do this, click Appearance > Customize Additional CSS in the WordPress dashboard.

Copy the code to the Extra CSS field:

.entry-date 
 display: none !important;
 

Hit the button to publish button to bring those changes into effect.

Add CSS in the WordPress Customizer
Add CSS in the WordPress Customizer.

The publication date gone, however the last updated date is still shown.

Frontend view of the last updated date still there without the published date
Frontend view of the latest updated date still there without the date that was published.

Be aware that even though using the .entry-date CSS class name is common in many themes, it's not utilized in the majority of themes. Therefore, if this formula doesn't suit your needs the reason is likely to be because your theme has an unrelated class name, which isn't .entry-date.

But the CSS code remains good, so all you have to figure out is the name of class that your theme is using to determine the publication date. For that, navigate to the frontend of a blog post , and select the right-click on the date that was published that is currently displayed. Select Inspect. Inspect option (this differs based upon your web browser. Chrome employs " Inspect," Firefox uses " Inspect Element," and for Safari you need to hit the option key and press C)

Right click on the date and choose the Inspect option
Right click on the date, then select the option to inspect.

This reveals this is the developer's tools section in your browser. It shows the coding components of the page you are currently viewing, and in particular the CSS code for the webpage element that you clicked.

It should show up as the main element if you clicked on the date, but if not, look for a section for . The CSS class of your posted date should appear right after that; in this instance, it's entry-date. However, developers can use a variety of this when creating themes like post-date, posts-date published-date, posts-date and posted-date.

Look for the "time class=" snippet and the information after it
Look for the "time classes=" The snippet of text and the data after it.

Copy only that particular class (not the parentheses, or any the other components).

Paste the code in the following CSS snippet, replacing yourthemes-class-name. You must ensure that you include the punctuation marks before the class's name.

.yourthemes-class-name 
 display: none;
 

And that should do the trick!

The quickest (But only Sometimes Useful) Way to Get Rid of the Date Published

A simple and non-coded method to remove the published date however, keeping the date that was last changed (inserted from the previous method) This is done by cutting out date formatting within the WordPress General Settings.

If you are using WordPress In WordPress, click settings > general and go to Settings > General, then scroll down to Date Format as well as the Time Format sections. Select the Custom option for both of them and clear out the example formatting for each field. Select the Save changes button on the right.

Choose Custom and clear out the fields
Choose Custom and clear out the fields.
You should see the updated date without the published date on the frontend
It should show the latest date without the published date on the frontend.

Method 2: Edit Your Theme Template

There's a chance that you'll need to conduct some research, but the idea is to locate your templates (and the code contained within the template) responsible of sharing the post's date and time on the frontend. Again, developers differ on the types of templates they use, but you'll typically find the date of publication code within one of these templates.

  • index.php
  • page.php
  • single.php
  • archive.php
  • content.php
  • template-tags.php
  • template-functions.php
  • A PHP file located in the directory /inc directory.
  • A PHP file located in the "/post" folder
  • A PHP file located in the content directory.
  • The file is located in the extract folder
  • An image file in the /template-parts directory.

It's left up the discretion of the developer (and their design), so you must look around for where the right code is, or find a file with a different name from the one listed above.

Here are some suggestions for finding the right theme file:

  • Contact the developer of your theme and inquire which theme template controls the output of published dates for posts. It is also possible to conduct your search on the internet or through the theme's forum for users.
  • Look through the most popular template templates for themes. You can start by using index.php, page.php, and single.php for simpler themes However, the most popular themes employ files like /templates-parts, /excerpts, and /inc.
  • Make use of to use the FTP client's search function to look for examples of texts that are similar to those published dates, times find_the_time, or even get_the_date.

Indicators of the Published date contained in this file are:

Do you want to know how we increased our traffic over 1000%?

Join over 20,000 others to receive our weekly newsletter that contains insider WordPress advice!

  • An ode to the class of time
  • receive_the_date code
  • "Published" text
Various indicators to find the file that serves up dates
Various indicators to find the file that serves up the dates.

If you see indicators similar to this, choose an element within the code which is appropriate to put the last updated date. The best way to do this is to add the new code before or following the area which already shows the current date.

Copy and paste it into your desired spot:

$u_time = get_the_time('U');
 $u_modified_time = get_the_modified_time('U');
 if ($u_modified_time >= $u_time + 86400) 
 echo "Last Updated on ";
 the_modified_time('F jS, Y');
 echo " at ";
 the_modified_time();
 echo " ";
 
Paste the code into your template file
Incorporate the code in the template file.

Template files are more likely to take longer to identify the proper locations, however it pays off with several benefits -- mainly that the last updated date actually gets shown in several locations.

One of these areas is the one where you insert the code for posts. In this instance, you will now be able to view the latest modified date, as well as the content in the lower part of the page, directly ahead of the publication date.

The last updated date now shows on each post
The date of the last update is displayed on each blog page.

Modifying the template for your theme will also display the most recent date on the main blog/archive page. This is where all WordPress blog posts are listed in a chronological order. Therefore, every updated post reveals that date in the listing, providing site users even greater transparency about the freshness of your content.

This method also reveals the last updated date on your main Blog/Archive page
The method will also reveal the most recent date for updating the main blog/archive page.

Modify the location of where the Date of Last Updated Appears

Theme templates dictate how dates appear on WordPress posts. However, they also determine where the date is listed in the blog post.

So, you must utilize theme templates to change how the most recent or published date gets placed in a blog article. Sometimes, this is simply changing the code you've entered into Method 2 somewhere else in that same PHP file.

Other times, that PHP file could be an "template part" file. It is pulled out through a master template, which organizes all the template parts that result in the blog's layout.

Utilizing the Twenty Twenty One theme example from before, it's clear it's clear that template-tags.php file is just a tiny piece of code which is later incorporated into the master post theme file. Therefore, it's your job to ask the designer which theme template handles post formatting, or do some research on your own.

While we cannot guarantee that this works for every theme, it's an excellent start point for looking for the "master" theme template that is something similar to single.php, content-single.php, or even post.php.

In the case of for the Twenty Twenty One theme, it is possible to include the most recent code either in single.php or content-single.php, seeing as how single.php acts as an "master" template file, but content-single.php will be the templates file which single.php is pulling from.

Open the content-single.php file, or whichever template part file has the code that displays dates
Open the content-single.php file. Or, whichever template file contains the code that displays dates.

For moving the position of the date that was last updated use the code described in Method 2 and then paste the text where you would like the date to be. It is evident that the document has a head section, as well as a small excerpt of the content and we'll put the code for the date that was last updated right between those two by moving it away from its normal position beneath the content to right before the content.

Move the code to a suitable position
Transfer the code into a position that is suitable for.

On the frontend, the last updated date will now appear where we'd like it to, and you may either take out the duplicate date from the previous location (towards toward the bottom) or keep them both inside.

The last updated date is now at the top of the post
The most recent date for updating appears at the top of the page.

Adding the Last Updated Date in the Astra Theme

To give you an idea of how different each theme works, the Astra theme (with its Travel Blog starter template) isn't even showing the latest published date by default. Regardless, you can still insert the most recent date. To insert the date using method 1 in this post, go to /wp-content > /themes > theastra on the FTP client. Start the functions.php file.

Open functions.php
Open functions.php.

Copy your Method 1 code at the final page of your file, and copy it onto your server. It will show the latest update date appearing at the top of your blog's post.

A frontend view of the last updated date in Astra
A frontend view of the most recent date in Astra.

Using Method 2, find the template for your theme that is called single-layout.php. The template is located in /astra > /template-parts > single.

Open the single-layout.php file
Open the single-layout.php file.

The same code is used however, some themes will require you to indicate that the PHP code; so, add the          The code is enclosed in brackets if you're seeing code that appears on the frontend, but not rendering the date.

It should look like the following:

= $u_time + 86400) theCustom_content .= $content;
 return $custom_content;
 
include_filter(  the_content', show_last_updated' );

Place the snippet right above the line that includes the_content code.

Insert code into single-layout.php
Insert code into single-layout.php.

Uploading the new file to the server produces an up-to-date line prior to the content begins on Astra. Astra theme!

Last updated date result on the frontend of Astra
Date last updated on the frontend of Astra.

Adding the Last Updated Date within the Neve Theme

For turning on the option within WordPress Go on to Settings > Appearance Layout > Blog/Archive. Select the Post Meta drop-down. Make sure you can see that the Date is visible under Meta Order Then, turn on the option to " Use last updated date, not the original date."

The date that is the most up-to-date appears on the blog's page as well as each individual article.

Neve makes it easy with a Customizer setting
Neve can make it simple with a Customizer setting.

Inscribing the Date of Last Update within the theme Zakra WordPress

Zakra is a different one. You might be tempted that you need to visit the parts of your template folder within the WordPress files to locate the code that serves up the published date. The correct place is within the inc folder.

To add the last updated date to Zakra to add the date, connect using an FTP client, and then go into your site's /themes folder. After that, go to the Zakra folder, then to /inc >> template-tags.php. Edit the template file.

Open the template-tags.php file
Open the template-tags.php file.

Paste the previously discussed code between ); (from the get_the_time function) and the value of $posted_on is sprintf(. The file is saved to the server.

Paste the code inside the Zakra theme template
Copy the code into the template Zakra theme template.

The date now appears in the upper right-hand corner of all articles for the Zakra theme.

The last updated date on the frontend of Zakra
Last updated date is on Zakra's front-end. Zakra.

If you're having difficulty Editing Your Theme Design

Whatever the case, most problems when dealing with the last updated date are due to hard-coded files or some other form or uniqueness in the file. So, it's usually best to contact your theme developer and mention your goals. They can often provide an immediate solution using the correct CSS or PHP code in your particular circumstance.

Method 3: Apply the Plug-in

Having said that it is possible that none of these techniques work, or do not work as you'd like. Consider activating and installing this WP Last Modified Information plugin.

The plugin will take the guesswork out of the equation, it allows you to include the date that was last changed, adjust settings (like replacing the previously published date) and then format the date's appearance and place.

The WP Last Modified Info plugin
The WP Last Modified Information plugin.

Once it is activated, visit Settings > WP Last Modified Infoin The WordPress dashboard. On the post Options Page, toggle on the option on "Enable for Pages and Posts on the Frontend."

Enable for Posts and Pages on the frontend
Make it possible to enable Posts and Pages on the frontend.

It is also possible to switch the method used to display to:

  • Before Content
  • After Content
  • Replace Published Date

Scroll down on the page to locate other settings for:

  • Date formatting
  • Time formatting
  • Time gap
You can choose to replace the published date with the last updated date
It is possible to substitute your published date by the most recent date.

Make sure to save those settings so that you can display the date of last update at the top of your website. If you notice something that doesn't appear just right, revisit the settings to see what you can do that can fix the issue to how you want to be able to see.

A frontend view of what the plugin displays
The front-end view shows what the plugin displays.

The plugin automatically activates the date of last update for pages, too. If you'd like to change this default, head back to the settings of your plugin to fill in the " Post Types to display updated information" field. Simply type "Posts" into the field to make sure that nothing is modified for this pages posting type. With all the changes set make sure you click the Save Settings button.

Only show the updated date on Posts
Only show the updated date on posts.

What is the best way to tell when an WordPress Page or Post was last updated

The display of the latest updated date on the WordPress blog post is an important thing. But how do you actually see the date when a article was last updated? In the end, it's crucial in identifying old posts that you should modify.

In addition, looking at the last updated and published dates can help troubleshoot problems you may encounter while adding the latest date. For instance, most of the code used in this post requires that there actually be a last updated date for pulling. This means that you will not find any dates if the article hasn't been revised and you don't find until searching for a date on the backend.

Unfortunately, WordPress does not automatically show the modified and the Last Updated date in the frontend after you have added your pages and posts in spite of implementing one of the methods that we have provided in our previous methods. When you go to the posts page in WordPress displays only the publication date column.

There's only a Published Date column on the backend post list
There's only a Published Date column in the list of posts on the backend.

This is also true of the editors of pages and posts You can check the Post tab to find the Published date, but not the exact date when it was last updated.

Only the Published date gets shown by default
Only the date of publication is listed by default.

The Built-in Way to Get an idea of the Most Day of Update in WordPress

With no help from the built-in display functionality you should open the post in question and click on the post tab that is to the left. Look down for a revisions button.

  • If you do not see a Revisions button, that means you've never updated it.
  • If you see the revisions button, just click the Revisions button.
Click the Revisions button to view the list
Click the Revisions button to view the entire list.

Although this isn't a guarantee for finding the last updated date, it gives you an approximate picture of what's happening on this post.

Revisions get saved into WordPress regardless of whether you post the article Therefore, you could possess revision logs that don't have the most recent dates for updating. You can however look over the past revisions to see which of them you published the most recently, in accordance with the contents of the revision.

Each revision logs the date and time, which you can bet on as the most recent date as well.

Check for the Last Modified date within the revisions
Find the date of Last Modified within the revisions.

If you've already implemented the most recent date-updated code in an earlier method but you're still not seeing a date on the frontend it's a good method to determine if the posting has an up-to-date date in the first place and if not it won't show anything.

You can also use a plugin Locate the Date of Last Update on the Backend

The WP Last Modified Info plugin isn't just a way to add the Last Modified date to the frontend but also creates columns and sections throughout the dashboard to make it easier to spot posts you haven't updated in a while.

Once you've got the WP Last Modified Information plugin and activated, go to the posts list on WordPress. The plugin automatically creates a new column next to Date called Last Modified.

The plugin includes a new backend column for the Last Modified date
The plugin includes a new column in the backend for the date of last modification.

The plugin displays an additional tab in the post editor that is called Last Updated that displays the last update date and time of the specific post.

The Last Updated tab within the post editor
The tab for Last Updated is located within the post editor.

Summary

In this article, you learned:

  • How to tell when the website last changed?
  • The advantages of having the most recent date of update on your website
  • How do I show the most recently updated date in WordPress using the following methods:
  • Method 1: Modifying functions.php and CSS within your theme
  • Method 2. Editing template templates for themes
  • Method 3. Making use of a plugin similar to WP Last Updated Info

We also explored tips on:

  • How do you change the design of the last updated date
  • How to remove the last updated date from pages and anything else that's not a post
  • Then removing the publication date, so that only the last day that was updated appears.
  • Change the place where the last updated date is displayed on a page

In the end, we demonstrated how you can add the most recently updated date to several popular themes, including:

  • Twenty Twenty One
  • Astra
  • Neve
  • Zakra

Tell us in the comments section if you need any additional help on how to show the Last Updated date on your WordPress website!

Reduce time, money and increase site performance:

  • Instant help assistance from WordPress hosting specialists, 24 hours a day.
  • Cloudflare Enterprise integration.
  • Global audience reach with 34 data centers worldwide.
  • Optimization using our built-in Application Performance Monitoring.