Opened 11 months ago
Closed 11 months ago
#7410 closed enhancement (reported-upstream)
Show modified date in google results
Reported by: | benniledl | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Developer Hub | Keywords: | |
Cc: |
Description
Show modified date in google results rather published date
Attachments (2)
Change History (6)
#1
@
11 months ago
- Keywords 2nd-opinion removed
I suspect this is google picking up the first <time>
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 <time>
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>
#2
@
11 months ago
Likely easiest fix is adding Structured Data (<script type="application/ld+json">
), see https://developers.google.com/search/docs/appearance/publication-dates
@benniledl Would you be able to create an issue on the Github repo for Developer? https://github.com/WordPress/wporg-developer/issues/new
search result