How to Display Last Updated Date In GeneratePress WordPress Theme?


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

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 have a word about the importance of having the “last Update” date in your blog posts.


Why Showing Last Updated date in WordPress?

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

It is a good SEO practice!

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

The updated articles provide a good user experience for the readers and no doubt that they will 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 that helps to lower the bounce rate of your site, and search engines can give you a ranking boost for the targeted keywords.

I hope you have grasped the reason for updating the website content with the latest information.

Now, let me tell you how to enable the last updated feature for the GeneratePress theme users.

Displaying The Modified Date For Your Readers

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


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

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

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 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> ',
}, 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.


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.

Expose The Altered Date In WordPress With Plugin

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

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

The plugin does several tasks like

  • Adds the last modified date to 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 screen and quick edit screen.
  • Gives the manual insertion choice through the shortcodes.

Best Features

  • Compatible with the 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 by ascending or descending order.

Wrapping Up

Google hates the outdated content and therefore introduced the “Freshness Algorithm.” It always gives priority to 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 it in the functions.php file. The job will get done, and you will be able to see the change of date 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.

25 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.


  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.

    • 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

      • 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

  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.

  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.

  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.

  6. Hi there!!!

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

  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 🙂

  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,


Leave a Comment