How to Display Last Updated On: Date/Time of WordPress Blog Post? Genesis Framework Hook Included

Last updated
App Shah
Crunchify » WordPress Genesis Framework Tutorials » How to Display Last Updated On: Date/Time of WordPress Blog Post? Genesis Framework Hook Included

How to Show Last Updated Date in WordPress Blog? How do I see the last time a WordPress update was updated?

Make sure to have Last Updated Date on WordPress Blog Post

Search Engine Optimization (SEO) is a very big topic. There are lots of consideration you have to keep in mind in order to have correct SEO implementation for your blog. Google shows post publish date in search result page.

Here are few Crunchify’s featured examples:

Last Updated On - Date:Time of your WordPress Blog Post

Sometimes you may have to modify blog post if you find some code bug or typo. In such a case it’s advisable to update date appropriately.

Let’s say you have published post on March 2nd, 2022 and for some reason you update post on March 13th, 2022 then post should tell March 13th, 2022.

Making your content appear fresh to Google.

Adding Last Updated Timestamp On Your Blog Posts

Let’s get started:

Look at below changes:

WordPress Post - Published On Date for SEO ranking

Change Published On to Last updated on

WordPress Post - Last Updated On Date for SEO ranking

I’m using Genesis Framework, and it’s very easy to update this with simple hooks. Just put below code to your child themes functions.php file and you should be all good.

function crunchify_get_updated_date_for_post() {
    $date = '<i>' . get_the_modified_date() . '</i>'; 
    return $date;
}
add_shortcode( 'crunchify_modified_date', 'crunchify_get_updated_date_for_post' );

add_filter( 'genesis_post_info', 'crunchify_add_updated_date_info' );
function crunchify_add_updated_date_info($post_info) {
	$post_info = 'Last Updated on [crunchify_modified_date] by [post_author_posts_link] [post_comments] [post_edit]';
	return $post_info;
}

If you are not using Genesis Framework and want to achieve the same then follow below steps:

Step-1

Open below files:

  1. index.php
  2. page.php
  3. single.php

Step-2

Look for an entry for post meta in above files i.e. Posted on or Updated on  and update this accordingly.

<?php if (get_the_modified_time() != get_the_time()) : ?>
		<p>Posted: <?php the_time('F jS, Y'); ?> at <?php the_time('g:i a'); ?>, Last Updated on: <?php the_modified_time('F jS, Y'); ?> at <?php the_modified_time('g:i a'); ?></p>

	<?php else: ?>
		<p>Posted: <?php the_time('F jS, Y'); ?> at <?php the_time('g:i a'); ?></p>
<?php endif; ?>

What is your plan?

Are you planning leave Default WordPress Date or planning to update your blog which shows Last Updated on: Date?

I would highly recommend changing it to Last Post Update date.

Google Last Updated Date

24 thoughts on “How to Display Last Updated On: Date/Time of WordPress Blog Post? Genesis Framework Hook Included”

  1. Hi I would like to add the code to a custom functions plugin that will be used for various themes Genesis and others. How would I go about adding the code to the plugin?
    Thanks!

    Btw I am building this custom functions plugin: https ://github. com/ paaljoachim/my-most-used-custom-functions-plugin

    Reply
    • Hi there – sure. Please go ahead and use it in your plugin as far as it’s under the same license as WordPress :). Would be nice if you give credit to Crunchify too.

      Reply
  2. Hello there?
    I successfully managed to add modified date my post. But I dont want date to appear on the home pages. Only when user opens that post it should show the modified date. Please guide me for this.
    Thank you. 🙂

    Reply
  3. Is there any way to type code literally at the very bottom of the post being updated that provides the updated date jargon to satisfy the Google search for updates? I don’t use a ChildTheme… only plugins and default 2014 WordPress Theme.

    Reply
  4. Hi App Shah, I’m using genesis framework and I added the code to my website, but updated date and time is not displaying on my site. Old date and time still exists. Please help me out. While searching Net, I found you only have some solution for it. Please dont ignore my comments 🙂

    Reply

Leave a Comment