Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show modified date in google results #477

Open
at-benni opened this issue Jan 17, 2024 · 3 comments
Open

Show modified date in google results #477

at-benni opened this issue Jan 17, 2024 · 3 comments

Comments

@at-benni
Copy link

at-benni commented Jan 17, 2024

Trac Ticket: https://meta.trac.wordpress.org/ticket/7410

Show modified date in google results rather published date

Image

Image

@dd32
Copy link
Member

dd32 commented Jan 18, 2024

Copying my comment from the linked trac ticket to here.

I suspect this is google picking up the first element on the page.
The sitemap is correct:

https://developer.wordpress.org/sitemap-2.xml

1227 https://developer.wordpress.org/reference/functions/get_the_modified_date/ 2023-11-08T01:35:16Z

And the only place the 2014 date shows is:

$ curl -is https://developer.wordpress.org/reference/functions/get_the_modified_date/ | grep 2014
<div class="wp-block-post-date"><time datetime="2014-04-25T06:04:56+00:00">April 25, 2014</time></div>

If it's indeed using the element, maybe we need to add a rel attribute or something to it, such that it picks up the right one.

$ curl -is https://developer.wordpress.org/reference/functions/get_the_modified_date/ | grep '<time'
<div class="wp-block-post-date"><time datetime="2014-04-25T06:04:56+00:00">April 25, 2014</time></div>
<div class="wp-block-post-date__modified-date wp-block-post-date"><time datetime="2023-11-08T01:35:16+00:00">November 8, 2023</time></div>

Likely easiest fix is adding Structured Data (<script type="application/ld+json">), see https://developers.google.com/search/docs/appearance/publication-dates

@dd32
Copy link
Member

dd32 commented Jan 18, 2024

Flipping the order of the <time> elements may also work, but I'm not sure if that's a 100% fix

@jonoalderson
Copy link

There's no way to control the date that Google shows in SERPs.
Managing the metadata and constructing some schema would definitely help, but that'll take some scoping. Leave it with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants