Having trouble to show the last modified date on the WordPress website?
This article includes step by step tutorial using which you can show the modification date in Newspaper X theme.
This article is for Newspaper 10 users only. It might not work for you if you are using any other theme.
You need admin credentials to access your cPanel (for the second method). I am going to make changes in the plugin files which require access to the file manager.
cPanel will provide you with full access to view or modify the data.
You can ask your admin team to make the changes for you.
A little bit of coding knowledge is helpful but not necessary. You can just follow the steps carefully to make changes.
How to show the Last Modified Date in WordPress?
There are two methods to change post creation date to last modified date. Both of them work great.
Using the shortcode method, you have to make changes in your theme files. So, you have to be a little careful here.
The plugin provides you super safe method without any knowledge of coding and file editing stuff.
Both have advantages and disadvantages, which we have discussed in the upcoming section.
1. Using Shortcode
We are going to change the function which fetches the post publish date (get_the_time). We will replace it with the one which will get the article modification date (get_the_modified_date).
You can watch the video mentioned below for step by step tutorial.
Follow the below steps to enable last modified date –
- Login into your cPanel account.
- Open file manager
- Goto below mentioned path.
- Find and edit the file mentioned below.
- Go to line number 332 or find the code shown below.
$buffy .= '<time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . $td_article_date . '" >' . get_the_time(get_option('date_format'), $this->post->ID) . '</time>';
- Replace the above line with the code mentioned below.
$buffy .= '<time class="entry-date updated td-module-date' . $visibility_class . '" datetime="' . $td_article_date . '" >Last Modified On: ' . get_the_modified_time(get_option('date_format'), $this->post->ID) . '</time>';
- You can change the Last Modified On text to any other name of your choice.
- After pasting the text, save your file and close the editor.
- Now, refresh your post, and you can see the Last modified date instead of Published date.
2. Using Plugin
Using a plugin is very simple and easy. There are many WordPress plugins available for this.
One of the best plugins is WP Last Modified Info.
You can go to the plugins tab and add a plugin from there. Just search the plugin and install it.
The moment you activate it, it will start showing you the Last modified timestamp on all of your posts.
It shows both the dates, article publish date, and the post-modification date.
Why use a shortcode instead of the plugin?
The second method (plugin) will work for most of the bloggers. It is simple to use and doesn’t require any knowledge about coding.
But if you have little experience and confidence with the first method, I will recommend you use a shortcode instead of the plugin.
You can take help from your friends if they understand the code. Even if you don’t know, you can follow steps to show a modified date.
There are many advantages to the shortcode. Few of them includes –
- It will show you just the Modified date, not both of them as a plugin would.
A plugin will show you both the modified date and the published date. It could be quite annoying for a few of you.
- Shortcode won’t affect the speed of your website, but plugin could. Having a lot of plugins could decrease your site speed, and so are your rankings.
Showing the last modified date on posts may not affect your SEO but can affect how the user interacts with your websites.
If you have old articles that even if you keep updating, it can make users bounce away if they think that the page is outdated.
It will cause an increase in Bounce Rate even if you are providing value to the user.
It is always a good idea to show the user that your posts are updated regularly and provides the best information in the market.
Did it work for you? If you have any issues, then let me know through the comments section below. I will be more than happy to help.