How to Display Last Updated Date In GeneratePress WordPress Theme?

In this GeneratePress tutorial post, let’s see how to implement an important SEO strategy, “Last Updated Date,” for every piece of content that you write.

If you’re hesitant about buying the paid version, read the comparison – GeneratePress Free Vs Premium to determine which theme to use.

So, how can you display the modified date in WordPress when using the GeneratePress theme? Refer to the screenshot below, which displays the post modification date.

display modified date blog posts

Before getting into the details, let me discuss the importance of having the “last Update” date in your blog posts.

Disclosure: We get a commission when you buy a product via our affiliate link at no additional cost.

Why Show the Last Updated Date in WordPress?

show-last-updated-date-generatepress

Being a blogger for a decade, I’m familiar with the importance of updating old content. It is a good SEO practice!

As I continue to learn new things, I would always like to incorporate the latest information into the articles I have written.

The updated articles provide a seamless user experience for readers, who will undoubtedly engage more effectively with the most recent data.

Through this activity, you are providing an excellent opportunity for search engines to recognize your interest & knowledge in your niche, and in turn, earn you high search engine rankings.

The WordPress CMS, by default, displays the published date, which is not useful when you invest a lot of effort in altering the site’s content.

While making your content “Ever Green,” displaying the latest modified date is essential so that the readers and search engines understand that the article has been revised.

Therefore, the readers stay long in your article, which helps lower your site’s bounce rate, and search engines can boost your ranking for the targeted keywords.

I hope you understand the reason for updating the website content with the latest information. Let me show you how to enable the ‘Last Updated’ feature for GeneratePress theme users.

1. Display The Modified Date For Your Readers

If you want to display the updated date for the revised articles only to readers, follow these steps.

Step 1: Copy the following CSS code

.posted-on .updated {
    display: inline-block;
}

.posted-on .updated + .entry-date {
    display: none;
}

Step 2: Paste the code in your custom CSS section.

For that, visit WordPress Dashboard > Appearance > Customizer (Refer screenshot below)

add code last modified date

Step 3: To change the text, again, paste the following text in that same custom CSS section.

.posted-on .updated:before {
    content: "Last Updated ";
}

2. Show The Updated Date For Google Without a Plugin

Revealing the last updated date for Google is the best SEO tactic. Let’s see how to do it in the GeneratePress theme without a plugin.

Step 1: Copy and paste the following code in your theme function.php file (refer to screenshot below)

add_filter( 'generate_post_date_output', function( $output, $time_string ) {
    $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';

    if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
        $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Last Updated On %4$s</time>';
    }

    $time_string = sprintf( $time_string,
        esc_attr( get_the_date( 'c' ) ),
        esc_html( get_the_date() ),
        esc_attr( get_the_modified_date( 'c' ) ),
        esc_html( get_the_modified_date() )
    );

    return sprintf( '<span class="posted-on">%s</span> ',
        $time_string
    );
}, 10, 2 );

Step 2: If you want to change the text, refer to the screenshot below, where I have marked the text with an arrow. You can then change the desired text and paste the code.

edit-text-last-updated-date

Note: After adding the code to the functions.php file, please wait for a few minutes to see the date in the search results. It depends on the crawling frequency of the search engines to your site.

It is a working strategy for the ranking boost. Therefore, ensure that you implement this procedure. Our few blog posts improved their ranking positions after performing this procedure to provide the exact modified date for search engines.

3. Expose The Altered Date In WordPress With a Plugin

I found a great WordPress plugin for non-tech-savvy users who hesitate to include the code in the functions.php file or CSS editor.

It is “WP Last Modified Info,” with over 40,000 active installs.

The plugin does several tasks like

  • Adds the last modified date above or below your posts & pages
  • Allows you to customize the text as per your wish
  • Let you display the last modified info in a human-readable format (Days, weeks, years or months ago)
  • Offers the option to edit the last modified date and time from the post-edit and quick edit screens.
  • Provides the manual insertion option through shortcodes.

Best Features

  • Compatible with well-known SEO plugins and themes like Genesis & Divi.
  • Detailed settings
  • Automatically inserts “Date Modified’ schema markup to your blog posts
  • Can be used as a template tag
  • Sort the modified posts and pages either in ascending or descending order.[/su_list]

You can also use the WordPress plugin, Code Snippets, to add the code to expose the “Last Updated Date” in the GeneratePress WordPress theme.

And if you don’t want to install & use any third-party plugin, you may create your plugin with the help of another plugin – Pluginception and then add the code to show the last update date in the GP theme.

How To Show Last Updated Date In GeneratePress Theme – Video Tutorial

If you prefer not to read the content, I have a video tutorial that provides clearer explanations of the “Last Updated Date” in the GeneratePress WordPress theme.

Update

I have just updated this article with the latest information and would like to include a new feature related to this blog post that I have implemented for this blog, designed using the GeneratePress theme.

So, when you frequently update an article (say, once or twice a week) and don’t want to display the modified date to search engines, use the WordPress plugin SCF to create custom fields to lock the updated date.

It’s a developer task! If you need any help in creating such custom options in the GeneratePress theme, contact me at [email protected]

Wrapping Up

Google hates outdated content and therefore introduced the “Freshness Algorithm.” It always prioritizes the articles that have been updated with useful information.

Showing the “Last Updated” date in your WordPress blog posts is a helpful SEO approach that can be implemented quickly, as I described above.

If you use GeneratePress theme, copy the given codes and paste them into the functions.php file or use a third-party plugin to add the codes; see the date change reflected in the search engine results.

Other GeneratePress Tutorials

How To Add Author Box In GeneratePress?

How To Remove Built With GeneratePress?

How To Add Sticky Sidebar Using GeneratePress?

by Anil Agarwal

Anil Agarwal is a full-time blogger and SEO expert with over 20 years of experience in the field. He's one of the well-known bloggers from India who has been featured in major publications like Forbes, HubSpot, Shopify, and Business Insider.

58 thoughts on “How to Display Last Updated Date In GeneratePress WordPress Theme?”

  1. Hey Sakthi

    This is a very useful post.
    Actually I was curious to implement this feature on my blog and I was searching for this from the last few days without changing to the core theme files.
    Every method I found was showing both posted and updated dates.

    This is exact what I was looking for.

    Thanks

    Reply
  2. Hey Sakthi

    I have already implemented the CSS method.
    Now for SEO, I want to implement the second method you mentioned above.
    Just wanted to ask is it safe to directly update the theme files?

    Please let me know as soon as possible.
    Thanks

    Reply
    • Hi,

      Sorry for the delay, It is safe to update the functions.php file. Make sure that you have a backup. When you are updating the Generatepress theme, copy the code and add it again.

      There is another method using Hook where you don’t need to do anything after adding the codes. I’ll publish this article soon. If you need any other help, please let me know

      Reply
      • Hey

        First of all I did remove the CSS code.
        I took the backup of functions.php by simply copying the whole code in a doc file and then added the code you mentioned above.

        And I updated one of my post as it was required, it’s working absolutely fine.

        Thanks for the replying

        Reply
  3. Hello Sakthi,

    I was searching for this information after moving to Generatepress. Finally, I updated the theme to show the last modified date.

    Thanks for sharing this useful post.

    It was really helpful.

    Reply
  4. Wow, this is a really ultimate guide. I am new to website designing and all that. And I found your blog and I spent nearly 30 mints on this blog to read. Now I have a lot to work on. I just wanted to say thank you for creating good posts like this.

    Reply
  5. Thanks a lot. I have just modified the last updated date in my theme using your CSS code. It would be nice if the author has provided the same as a setting in the premium version. Let’s hope it will be implemented in the coming updates.

    Reply
  6. Hi there!!!

    I love to read your article and it’s very informative. I would love to read more articles from your side.

    Reply
  7. How do I create Author Box Like WP Glossy? Also, Make a video on How to customize Generatepress theme like WPGlossy. Excited to learn 🙂

    Reply
  8. Hello Sakthi,
    It was another nice explanation and really helped me to modify last updated date in GP theme. Thanks buddy keep helping 🙂
    Best Regards,
    Suraj

    Reply
  9. Can I hook these php code in GeneratePress Custom Elements? Basically I am using my Custom Elements to show article’s header (title, author and published date), and I want to show the updated date before the published date in same custom header.

    Reply
  10. Thank you so much for your article on how to show last updated date in generatepress theme.This is really helpful.
    thank you again.
    regards.
    soochna news.

    Reply
    • It’s working now! Yes, when there is an update from GeneratePress, the code will get removed and we need to add again. I have done the same now. However, I’ll post the tutorial to make the codes remain forever even when we update the GeneratePress theme.

      Thanks for showing interest to read my blog posts and your comment with care is much appreciated. Stay Tuned!

      Reply
  11. “Amazing write-up! No doubt, this is a useful post. I will bookmark this site for your future post. Thanks for sharing such nice article. “

    Reply
  12. Hello Sakthi,

    I was searching for this information after moving to Generatepress. Finally, I updated the theme to show the last modified date.

    Thanks for sharing this useful post.

    It was really helpful.

    Reply
  13. Hey Sakthi

    I have already implemented the CSS method.
    Now for SEO, I want to implement the second method you mentioned above.
    Just wanted to ask is it safe to directly update the theme files?

    Please let me know as soon as possible.
    Thanks

    Reply
  14. Even I don’t have generatepress theme in my blog but I really liked your post because it had very information and I like that theme too.

    Reply
  15. Hello Anil!

    Very useful Post, I’m using authority pro Theme please let me know How I can show last modified date in serp?

    And above given code can work in Authority pro Theme?

    Waiting for your reply

    Thanks and regards
    Vishal Meena

    Reply
  16. Hi Anil.

    Can you please tell me how do I show the last updated date to Google with a plugin? Because I am not comfortable with this functions.php method.

    Thanks.

    Reply
  17. Greetings Wpglossy!
    Firstly I would like to say thanks to you for such a wonderful article. I was looking for it to show the updated articles on my site and I reached on this article. I have applied and it successfully worked for me.
    Question: I would like to ask that how we can show the updated date for our pages in generatepress theme?
    I have created some pages which are very important for me. Can you please share the code for this?
    Thanks in advance!

    Reply
  18. The Defender Pro plugin sounds amazing, and I am thinking about using it myself. Anyways, I will share this resource with my group to help them build their secure and optimized WordPress website.

    Reply

Leave a Comment