How to Show Last Modified Date in WordPress Posts and Pages

0
How to Show Last Modified Date in WordPress Posts

WordPress, The most favourite and most widely used open source tool used for blogging and also, for Other things like business websites etc.So when you update your blog post or page you need to display your user, the content is up-to-date so they can make most of it, so today we are going to explain more than one methods to show/display last Updated/modified date of WordPress Blog post or page.

What you will learn today:

  • Display the Last Updated Date in WordPress Blog Posts or pages
  • How to Display Last Updated Date in Newspaper WordPress Theme
  • How to Display when a Post was Last Updated in WordPress
  • How to Show Last Modified Date in WordPress Posts and Pages

Advantages of showing last modified or updated date of blog posts in WordPress:

  • SEO – search ranking will increase as Google loves to show updated content to its users rather than showing outdated content or article.How to Show Last Modified Date in WordPress Posts
  • The returning visitors to your site will also check for updated content or latest version of your post, so be prepared for that

1st method:

In this method, we will edit the code in single.php, if you want to do it using the plugin then go below to next methods

  • First login to your web-hosting CPanel
  • Now open the file manager
  • If you use cloud then login your FTP/SFTP account
  • Go to wp-content/themes/your_theme
  • Press Ctrl+F and search for single.php
  • Now edit the Single.php and find the following code:
  • Posted on: <?php the_time(‘l, F jS, Y’) ?>
  • And replace it with the following code:
  • Posted on <?php the_time(‘F jS, Y’) ?>
    <?php $u_time = get_the_time(‘U’);
    $u_modified_time = get_the_modified_time(‘U’);
    if ($u_modified_time != $u_time) {
    echo “and Last Modified On “;
    the_modified_time(‘F jS, Y’);
    echo “. “; } ?>
  • Now you’re done, your posts will now show the last modified date of the article.

2nd Method:

Using Last modified Plugin to display the last updated date of wp blog post

  • WP Last Modified 
  • Install this plugin and activate and you’re ready to go, now check your updated blog post and it will show the last modified date.

Bonus:

How to Display  Last Updated Date in Newspaper WordPress Theme

  • Follow the same procedure as in method 1 till step 4
  • Now search for loop-single.Php by pressing CTRL+F
  • Open it and find the following code
  • <?php echo $td_mod_single->get_date(false);?>
  • Now replace it the following code
  • <?php echo $td_mod_single->get_date(false);?> <span class=”td-post-date”> and Last Updated on: <span class=”entry-date updated td-module-date”><?php the_modified_date(‘F j, Y’); ?></span></span>
  • Now you can check your blog post and voila! you can see the last updated date on it.

Final touch:

We personally tested these method’s and results are perfectly awesome, so we are encouraging you to use these methods on your blogs too, to get higher ranking in search engines and enjoy!

Vithalreddy.M.B is the Editor of VMRworld.com & stackFame.com with a focus on startups, Startup News, Business, and Technology.He is also an Electrical & Electronics Engineer, Technology Lover and Entrepreneur by choice.Started His first startup at 21.