How to add last modified date in WordPress?

The Last modified date is very important. WordPress SEO or sitemap plugins use it to arrange the list of posts in the sitemap by the timestamp on which they were last modified. By doing this, the plugins help search engines in finding fresh content on the site quickly.

When you publish a post, website visitors may find an error in your article and they may make you aware of the same. Sometimes, you may feel that the post doesn’t have enough content or useful information to rank in Google or Bing and you may add new paragraphs to it.

When you make some changes to the post, WordPress will immediately update the last modified date of the post. Unfortunately, the CMS won’t show the new date on the posts and make website visitors or search engines aware of the same. Also, search engines will keep displaying the old timestamp instead of the new date even though the sitemap clearly shows the last modification date.

How to fix this issue? To fix this problem, you must add the last modified date in WP posts with the help of a plugin or make one change in the theme’s single.php file.

To manually add the modified timestamp to the posts, go to “Appearance” and choose the “Edit Themes” option. Now, from the list of files you see on the right side, click on the file with the title “Single Post” and change the function that outputs the post published date with the get_the_modified_time. If the function is accompanied with a label such as “published on” “posted on”, etc, change it to “modified on” or “updated on”. Once you do so, clear the site cache and open any of the posts on your site. You’ll now see the new date.

If the above steps sound difficult, you can use the WP Last Modified Info plugin. The latest version of this plugin can insert modified timestamp before or after content. It can also replace the template’s function that shows post published date with the one that will output the latest date.

WP Last Modified Info plugin

Users can configure WP Last Modified Info plugin to not add the date to the search, category archives, search page, post tag archives, the home page, etc.

What else can this plugin do? WP Last Modified Info can send an email to the email addresses the site owner/administrator specifies and to the email ID of the post publisher when the post has been updated by someone. It can sort posts displayed in the WordPress dashboard by their post modified timestamp and display the same.

WP Last Modified Info lets you import and export the settings. It can insert the JSON-LD schema code in the HTML of the post so that search engines can update their database with the new date.

Closing words: The easiest way to add the last modified date to posts of a WordPress site is to use the plugin we’ve shared above. If you don’t want to use the plugin, you can manually add the “post modified date” by following the steps we’ve shared above.


Pramod is the founder of wptls. He has been using WordPress for more than nine years. He builds web applications, and writes about his experiences with various WP products on this site.

Leave a Reply

Your email address will not be published. Required fields are marked *