If you have a blog or a news website, and you usually update your content, showing the date of publication of the posts can be confusing, as users may believe that a content is out of date when in fact you just updated it .
This happens because most WordPress themes show the date of publication of the entries instead of the date of the last time it was updated , which would be a much more relevant data of the freshness of the information that is offered.
If you use the Astra theme , either the free or the pro version, this is a setting that is easy to change, just adding a simple filter at the end of the Astra child theme functions.php
file (which you should have created and active) , this:
/ * Show only the date of the last modification * / function helpwp_entry_update_date ($ output) { $ output = ''; $ 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', 'help wp_entry_update_date');
Save the changes in the file and you will pass the publication date …
As of the date it was last updated …
In this way, visitors will know the date of the last modification of the information, instead of the initial date of publication .
Regarding the internal markup data of the post code, there is no problem with the search engines because Astra includes both the creation and modification date of the entries in the HTML , as you can see in the following screenshot.
YOU MAY ALSO BE INTERESTED IN …
Did you like this article? You can’t imagine what you’re missing on YouTube !