If you are using the Astra WordPress theme for your business site or blog, then you should know an important SEO strategy. It is simply about how to display the last updated date in Astra theme.
As I’m using the super-fast theme, Astra, for one of our blogs, I can clearly explain the step-by-step process so that you can easily implement it without any difficulty.
Before getting into the details, you should understand the importance of implementing the modified date display method for your blog content.
Disclosure: We get a commission when you buy a product via our affiliate link at no additional cost.
Why Show the Last Modified Date In WordPress?

Freshening up your content has many benefits! Google values fresh content, and search results also prioritize the latest information available. And hence, removing the date from your articles is a bad SEO practice.
So, the benefits of showing the last modified date of the blog posts are
- Gives the best user experience, as your readers will feel good knowing they are on the most recent content.
- Google introduced the EAT (Expertise, Authoritativeness, Trustworthiness) terminology in 2018. It is a ranking factor. Exhibiting the most recent date on your content reveals to Google that you stay active and value your readers’ requirements, which in turn improves your EAT score.
- The recently updated date will be displayed in search engine results, thereby boosting CTR. Finally, you will generate more leads or subscribers through increased organic traffic.

Latest Update
The latest version of Astra theme has inbuilt feature to show “Last Updated” date of your blog posts. It has been recently intorduced as it is an essential to display the date when a post was last modified. This helps readers and search engines know that your content is up to date
Settings
Enable this feature from the Astra Customizer!
Visit WordPress Dashbord > Appearance > Customize > Single Post

Click the arrow near Post Title

Now, you will get option “Last Updated”under Meta Date tab, enable it

That’s it! We should thank the team to make the things easier for us!
Showing Updated Date Using Astra Theme
Providing the content modification date to Google is an excellent SEO strategy that would improve the click-through rate in search results.
Let’s see how to do it in the Astra theme without any 3rd-party plugins.
Step 1: Go to your WordPress Dashboard > Appearance > Astra Options > Custom Layouts
Step 2: Click “Add New” to create a new custom layout, and the content editor will open.
Step 3: Click “Enable Code Editor” at the top, and you will be taken to the WordPress classic editor.

Step 4: Give the new page you are creating a title, and add the following code to the content area.
<?php
/**
* Display only last modified date in the post metadata.
*
* @param String $output Markup for the last modified date.
* @return void
*/
function your_prefix_post_date( $output ) {
$output = 'Last Modified on';
$format = apply_filters( 'astra_post_date_format', '' );
$modified_date = esc_html( get_the_modified_date( $format ) );
$modified_on = sprintf(
esc_html( '%s' ),
$modified_date
);
$output .= '';
$output .= ' ' . $modified_on . '';
$output .= '';
return $output;
}
add_filter( 'astra_post_date', 'your_prefix_post_date' );
?>

Step 5: If you want to change the “last modified on” text, then you may do so. Check the screenshot below and identify the spot to change the words of your choice.

Step 5: Now, scroll down to the “Custom Layout Settings” section, and choose the “Hooks” option under the layout.

Step 6: A bunch of choices will be displayed, and you need to fill in every field like
1. Action – It is the most admirable option given by the Astra theme. Yes, you can display the last updated date anywhere you want, such as the Header, Content, Footer, or Sidebar. There are so many selections available, and here I’m preferring “content_before” to show off the date just above the blog content.

2. Priority – You may pick any value for the priority, and here I have chosen “1“
3. Spacing – Here also, you may give your desired count to get enough space for the “last updated date”; here I’m going with the default value zero for both top and bottom spacing.
4. Display On – Here comes the critical part, where to implement the “Last Modified Date”? Astra theme provides several options to execute the process according to the pages, posts, tags, categories, archives, and specific pages or posts.
I would like to perform the procedure for my whole site, and hence I have picked the option “Entire Website”

Note: Not to display the updated date on particular posts, pages, tags, categories, archives, and taxonomies is also made possible by the Astra theme team.
5. User Roles – Your website may have different user roles, like the author, editor, contributor, subscriber, and SEO manager, to handle the content. You may restrict showing the recently modified date for specific user roles. Here I’m choosing “All” and you may go with the suitable choice.

I’m sure you will love the comprehensive settings options provided by the Astra theme for presenting the last updated date details of the site content.
How To Display The Altered Date In Astra Theme Free Version?
If you are using the free version of the Astra theme, you will not have access to the “Custom Layout” option for the Hooks feature.
So, you have to rely on a third-party plugin like “WP Last Modified Info” to display the last updated date of your blog posts. This plugin is compatible with any WordPress theme.
You can customize the plugin as you wish and change the text “Last Updated On.” This is an SEO-friendly theme with 20,000 active installations; you can install and use it without hesitation.
However, I suggest you read Astra Free Vs Pro and upgrade to the premium version to outperform your competitors.
Wrapping Up
Google doesn’t like old content, and it gives higher rankings to content that’s been updated with recent information. Your blog audience and Google search users are also looking for the latest article with trending news.
So, when you display the last modified date for both search engines and your readers, then you will stay authoritative in their eyes. It paves the way to win your readers’ hearts and get top search engine rankings, which boosts your organic traffic.
I hope you have learned the easy way to display the updated date for blog posts & pages in the Astra WordPress theme. If you have any difficulty adding the codes, feel free to reach out to me in the comments.
You can get the same feature in the GeneratePress theme as well. If you get a chance to use this super lightweight theme, make sure to know how to display the last updated date in the GeneratePress theme for WordPress.



Your blog is really great. I can learn a lot from your content. Thank you so much for gifting us this beautiful blog.
Hey Sakthi, I have the ready-made code for Astra users. I would love to present it here for your readers. This code is directly applicable to for Astra theme but with change of the function names (easy task) it will work on all themes. I myself use it on my site.
//Example//
Before- “September 13, 2020 / By Ajay Choudhury”
After- “Last Updated on September 13, 2020 By Ajay Choudhury”
The code is :
function your_prefix_post_date( $output ) {
$output = ”;
$format = apply_filters( ‘astra_post_date_format’, ” );
$modified_date = esc_html( get_the_modified_date( $format ) );
$updatetxt = “Last Updated on”;
$postedtxt = “Posted on”;
$u_time = get_the_time(‘U’);
$u_modified_time = get_the_modified_time(‘U’);
$modified_on = sprintf(
esc_html( ‘%s’, ‘%s’),
$modified_date
);
if ($u_modified_time >= $u_time + 86400) {
$output .= ”;
$output .= ‘ ‘ . $updatetxt . ”;
$output .= ‘ ‘ . $modified_on . ”;
$output .= ”;
return $output;
}
else {
$output .= ”;
$output .= ‘ ‘ . $postedtxt . ”;
$output .= ‘ ‘ . $modified_on . ”;
$output .= ”;
return $output;
}
}
add_filter( ‘astra_post_date’, ‘your_prefix_post_date’ );
add_filter( ‘astra_post_meta_separator’, ‘__return_false’ );
Now for the implementation of the above code just paste it in the functions.php if you are using a child theme. If you are not using a child theme you can use the code snippet plugin and add the above snippet as advised by Sakthi in the post.
Was searching for this since a long time, Glad found this here. Thank You for the tutorial.