How to Display Last Updated Date In GeneratePress WordPress Theme?

show-last-updated-date-generatepress

We recently bought the GeneratePress premium plugin and decided to write some useful tips for its users.

If you are hesitating to buy the paid version, check the GeneratePress Free Vs Premium comparison to understand which theme to use.

In this GeneretePress tutorial post, let’s see how to implement an important SEO strategy.

It’s about the “Last Updated Date” for every piece of content that you write.

So, how to display the modified date in WordPress that uses the GeneratePress theme?

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

display-modified-date-blog-posts

Why Showing Last Updated Date in WordPress?

Being a blogger for a decade, I’m familiar with the importance of updating old content.

It is a good SEO practice!

As I keep learning new things, I would always like to include the latest information in the articles I have written.

The updated articles provide a good user experience for the readers, and they will undoubtedly engage well with the most recent data.

Through this activity, you are giving an excellent opportunity for the search spiders to recognize your interest & knowledge in your niche and bless you with high search engine rankings.

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

While making your content “Ever Green,” displaying the latest modified date is essential so that the readers and search engines understand that the matters in the article got 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 have grasped the reason for updating the website content with the latest information.

Let me tell you how to enable the last updated feature for the GeneratePress theme users.

1. Displaying The Modified Date For Your Readers

If you want to show the updated date for the revised articles only for the readers, execute the following 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 below screenshot)

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. Showing The Updated Date For Google Without 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 below screenshot)

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, see the below screenshot, I have marked with an arrow; there you can change the text you want and paste the code.

edit-text-last-updated-date

Note: After adding the code in the functions.php file, you have to wait for some time 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. So, make sure to implement this procedure. Our few blog posts got improved ranking positions after performing this procedure to tell the exact modified date for the search engines.

3. Expose The Altered Date In WordPress With Plugin

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

It is “WP Last Modified Info,” with more than 10K active installs.

The plugin does several tasks like

  • Adds the last modified date above or below your posts & pages
  • Lets you customize the text as per your wish
  • Allows you to display the last modified info in the 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.
  • Gives the manual insertion choice through the shortcodes.

Best Features

  • Compatible with well-known SEO plugins and themes like Genesis & Divi.
  • Deep 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.

You may also use the WordPress plugin – Code Snippets to add the codes 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 codes to show the last update date in the GP theme.

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

If you feel lazy to read the content and for better clarity, we have a video tutorial showing the “Last Updated Date” in the GeneratePress WordPress theme.

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 is a helpful SEO approach, and it can be implemented quickly, as I described above.

If you are a GeneratePress theme user, copy the given codes and place them in the functions.php file or use a third-party plugin to add the filter codes. The job will get done, and you can see the date change in the search engine results.

by Sakthi
Sakthi is a thoughtful guy who specializes in WordPress Setup & Design. He is interested in designing the functional & attractive WordPress themes for the Digital marketers & Bloggers and helping them attain their goals with a tailored site. Look his ThemeForest Portfolio.

57 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
    • 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
  10. “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
  11. 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
  12. 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
  13. 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
  14. Hello Sakthi!

    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
  15. Hi Sakthi.

    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
  16. 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
  17. 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