Yoast / wordpress-seo

Yoast SEO for WordPress
https://yoast.com/wordpress/plugins/seo/
Other
1.76k stars 887 forks source link

The conditional tag article:published_time outputs for posts but not for pages #21433

Open josevarghese opened 3 months ago

josevarghese commented 3 months ago

Issue moved from Jira: https://yoast.atlassian.net/browse/IM-774 Reporter: @michaelbriantina

Please give us a description of what happened

Description In our documentation here, we state that we output the article:published_time for both posts and pages.

When creating a new post, it outputs both the article:published_time and article:modified_time.

image-2020-11-13-16-16-05-639

However, when creating a new page, it doesn't output the article:published_time. It does output the article:modified_time though. Also, the datePublished and dateModified schema are also outputting accordingly.

image-2020-11-13-16-21-05-243

Is this a bug or do we just need to update our developer documentation for the article:published_time section?

Impact This could potentially cause issues for any websites or crawlers that use the article:published_time conditional tag. "The article:published_time doesn't output for pages which isn't in line with our documentation"

WP: 6.5.4 Yoast: 22.8

josevarghese commented 3 months ago

Please inform the customer of conversation # 787111 when this conversation has been closed.

josevarghese commented 3 months ago

Comments: Jono Alderson (November 27, 2020 at 3:05 PM)

Some feedback that we also output article:modified_time (but not article:publish_time on custom post types).

To be clear, the documentation describes the correct behaviour.

On post and page post types, we should output both of these tags. On other post types, we should not output either tag (because we can’t reliably assume that these are appropriate for the content type).

Jannes (November 20, 2020, at 5:49 PM) Reopened, additional info: https://yoast.slack.com/archives/CGUL0LDQS/p1605275018023000

Jono Alderson (November 20, 2020 at 2:18 PM)

@ Jannes Do we need to re-open this following our discussions?

Jannes November 13, 2020 at 6:20 PM

The published date is only shown on posts. The wpseo_opengraph_show_publish_date can be used to add additional posttypes to add the publish date to other posttypes.

I have proposed this change to the docs: https://github.com/Yoast/developer-docs/pull/107. Since there is a filter present, I assume this behavior is intentional, so I’m closing this report.

jreagan007 commented 3 months ago

It would also be nice to have author info as many pages are published on dates that are prior to competitors with better authors. Also the opengraph twitter and other stuff should be available at least for graphql

student-programmer-6565 commented 3 months ago

Came here to report this for https://yoportal.com/ Am facing same date issue. Thanks you already know.