How to Display Last Modified Date in Your Post

In this fast changing world of web, time is an important factor. With new concepts and ideas being poured every day, any blogs or post published long time back may not be significance in the present time. Even Google promotes the recently updated and newer posts. Date of publish is an important factor in Google’s ranking algorithm. Even if your older posts are still relevant in current times, Google will regards it as outdated and your post will be pushed down in search results. Even the viewers want recent and updated posts. So, older the article becomes, it is less likely to be clicked by the user. In this article we will show you how to display last modified date in your post. When you make any search, you can see the date stamp in Google SERP Description.

How to Display Last Modified Date in Your Post

Solution of this problem is to regularly update your best posts and articles. Regular updates assure that the post is still relevant and useful. But the real problem is WordPress do not display updated date by default. Since it is the best practice to display last updated date instead of the posted date, you can modify the WordPress default rule with a simple line of code or with a plugin.

How to Display Last Modified Date in Your Post

Method #1

Using Plugins To Display Last Updated Date

Since all the themes are different, it is difficult to provide a common code to show updated date that works for all the themes. So using Plugin can be a safe and a better way to perform this task. You can use plugins like WP Last Modified and Last Modified Timestamp. If you are using Genesis theme then you can use plugin like Genesis simple edits.

The best and easiest option available for this task is the WP Last Modified. Although the plugin is old and has not been updated for years it still works. The good thing about this plugin is its simplicity to use and automatic revise meta data. It means you can send the updated date to Google from the plugin itself. The plugin saves you from lousy task of exploring and changing the theme files.

In order to install the plugin,first login to your admin dashboard. Navigate to Plugins > Add New. Search for the keyword WP Last Modified . Install and activate the WP Last Modified  plugin developed by Rahul Arora.

How to Display Last Modified Date in Your Post

Once the plugin is installed and activated, go to Settings > WP Last modified. You will be directed to the Plugin settings page. In the page click the checkbox to activate the show last updated time stamp. You can also set the position format and verb to display in the updated date. There is also the checkbox to activate the metadata information. Once you are done with the settings click on the save button to save the changes. Now your post and pages will have the updated date displayed.

How to Display Last Modified Date in Your Post

Last Modified Timestamp

Last Modified Timestamp is another option which you can give a try. This plugin can be easily found in the WordPress plugin directory and you can install it using the same method as mentioned for above plugin.

Also Read:   What is Theme in WordPress and How does It Work?

 How to Display Last Modified Date in Your Post

The plugin does not change the appearance of your website but gives you a few ways to display the updated date in the website. You can use shortcode or template function in your theme or plugin. The easy way is to insert the shortcode [last-modified] inside the posts to display the last updated timestamp

Method #2

Manual way of showing Last modified date in WordPress

For the successful implementation of manual method, you need to have the good knowledge of structure of WordPress files and basic PHP. You can use your WordPress dashboard editor to use this method. The method includes inserting a few line of code into the functions.php file.

First go to Appearance > Editor. You will be directed to the theme editor window. On the right hand side you can find the entire list of the template files. Find functions.php file and select it. The entire code of the file will be shown in the middle editor.

At the bottom of the file paste the following codes.

function show_updated_date( $content ) {
    $time = get_the_time('U'); 
    $modified_time = get_the_modified_time('U'); 
    if ($modified_time >= $time + 86400) { 
        $time_updated = get_the_modified_time('h:i a'); 
        $date_updated = get_the_modified_time('F jS, Y');
        $custom_content .= 'Last updated on '. $date_updated . ' at '. $time_updated .'; } $custom_content .= $content; return $custom_content; } add_filter( 'the_content', 'show_updated_date' );

And then click update button to save the changes. Now the last modified date should be shown in the post.

Conclusion

Displaying the last update date can play a major role for your website’s success. Both visitors and search engine love latest contents. So save your best posts from dying by simply displaying the updated date. We hope the article was helpful.

The following two tabs change content below.
Kantiman Bajracharya

Kantiman Bajracharya

Kantiman Bajracharya is a freelance web developer. He is a computer geek who has a Bachelor’s degree in Computer Engineering. He has earned lots of satisfied customers while working for numerous successful projects. He is also a WordPress theme creator and web article writer. On free time he likes reading philosophy books, traveling and playing chess.

Share This Post