Site logo

Archived topic

SERP Custom Post Date

5 replies · Started by Sam on July 19, 2022

Viewing posts 1–6 of 6

Hello,
I want to optimize the GP post date for SERP.
I want to show the post date when the post is still new (e.g., I haven't edited it or updated it yet).
But when it is updated, I want to show the latest update date. Not only to the users but to search engines as well.
Is this possible?

Hi there,

by default GP will output both the Published and Updated date, one of which is hidden using CSS.

Alternatively add the PHP Snippet provided here to your site:

https://docs.generatepress.com/article/generate_post_date_show_updated_only/

It will display only a single date ie. for new posts it will show the published and for updated posts it will show just the updated date

Hello David, sorry about the late reply.

I'm using a custom Content-Template for my posts.
The only date in my CT is the updated date.

So by using said CT does GP output the publishing date anyway?
I'm trying to hide the publishing date from search engines.

If you're using a Content Template that has replaced the default themes meta then GP is only going to output the Updated date.

But.... SEO or JSON-LD Schema plugins may add both dates in the <head> of the web page.
If you want to share a link to a post on the site i can take a look for that.

Good to hear!

Nothing on the web yet; I'm still building the site locally, but thank you, David.

I also appreciate the tip about the plugins. I'll check the view-source mode and see if anything besides GP is outputting the date in the <head> tag.

You're welcome

This archived topic is closed to new replies.