Blog

WEBFI-WordPress-How to Display the Last Updated Date of Your Posts in WordPress



Are you looking to display the last updated date for your posts in WordPress? This helps let your users know how recent your article is for their needs. In this video we will show you how to easily display the last updated date of your posts in WordPress.

Text version of this tutorial:
http://www.wpbeginner.com/wp-tutorials/display-the-last-updated-date-of-your-posts-in-wordpress/

If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.

Check us out on Facebook:
https://www.facebook.com/wpbeginner

Follow us on Twitter:
http://twitter.com/wpbeginner

Checkout our website for more WordPress Tutorials
http://www.wpbeginner.com/

Summary of this tutorial:

To start this tutorial you would want to connect to your host using FTP:
http://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/

Navigate to your theme’s folder under your wp-content/themes and find your theme’s name and locate the functions.php.

Navigate to the bottom and insert our code that checks for the published date.

Upload the functions.php back to your site and now when the last edited date is more recent your publish date it will show the last edited date on your site.

Should you have any issues with this tutorial we would recommend taking a look at our articles:

Beginner’s Guide to Pasting Snippets from the Web into WordPress
http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/

source

18 Comments

  • Santosh Biswal on August 22, 2017

    Thanks ya, you just saved me a plugin 😄😄

  • Terra Plana Terra on August 26, 2017

    Hello I Wish You Were A Video Lesson How To Put Bhutan In The Main Menu Please?

  • ASELA biz on September 14, 2017

    i want show only updated date not both how can i do it ?

  • Fatih Topuz on October 2, 2017

    That would be so useful for my website!

  • Louise Cunningham on October 2, 2017

    Love this idea but its a little more involved than I dare do. Guess I will reach out for help instead. Keep up the amazing videos!

  • David Venter on October 2, 2017

    Great tutorials. Thank you!

  • Harshad Parulekar on October 3, 2017

    Interesting

  • Jurica Zuanović on October 3, 2017

    Thanks for this helpful tweak

  • san1ty on October 3, 2017

    thanks

  • Hamlo Take on October 4, 2017

    Thanks!

  • Mursaleen Siddique on October 5, 2017

    most needed feature 🙂

  • Omar Chaaban on October 6, 2017

    thanks

  • Mehul Kanzariya on October 8, 2017

    Informative video!

  • Una Neary on January 15, 2018

    Does anyone know if there is there a plugin for 'last updated post'? Messing around with the functions.php file is fine if we have written our own theme. But I look after sites for clients, that have themes which are updated constantly. If we are building a new site of course we can do child themes but i believe it is not possible to make a child theme after the site has been up a few years.

  • Carrie Hughes on April 17, 2018

    Problem is that this is showing up on pages too. How do I get it to just show on posts?

  • Kongo TIMES on October 5, 2018

    Is this code compatible to be used with french accented letters? Because I getting some errors in my functions.php like:

    1) PHP Notice: Undefined variable: custom_content in /wp-content/themes/sahifa/functions.php on line 41
    2) PHP Notice: Undefined variable: custom_content in /wp-content/themes/sahifa/functions.php on line 44

    The lines between 41 to 45 are the following :

    41 $custom_content .= '<p class="last-updated">Dernière mise à jour, le '. $updated_date . ' à '. $updated_time .'</p>';
    42 }
    43
    44 $custom_content .= $content;
    45 return $custom_content;

    Note that I have updated in your code [$custom_content .= '<p class="last-updated">Last updated on '. $updated_date . ' at '. $updated_time .'</p>';] with some french accented letters because our website is in French, to [$custom_content .= '<p class="last-updated">Dernière mise à jour, le '. $updated_date . ' à '. $updated_time .'</p>';]

    I need some clarifications: Is this code compatible to be used with french accented letters?

    thanks in advance

  • Leswanth T on March 26, 2020

    But the last updated time is being visible for pages also… is there any code to let it show only for posts?

  • Abz Dominise on May 27, 2021

    Great video and tutorial. I have made it work on my site however, I only want it to appear on posts only. It keeps showing up on pages and frontpage. Is there a way for it to appear on published posts only? Thanks and more power!

WhatsApp us
Live Chat

Office hours operation Mon-Sun 8:00 am ET – 4:00 pm ET

To start your Premium WP or Cpanel service, use our domain search engine, if the domain you want is available, contact us by Whats app to activate your project.

The easiest, fastest, and most secure way to communicate with us.
loading
Please enter your domain.
Please verify that you are not a robot.

Terms Privacy

 

 

error: WEBFINET SECURITY IS ON