Prerequisites
Please give us a description of what happened
Discovered after a Copilot review, see https://github.com/Yoast/Platform/pull/4325#discussion_r3063025239
In that PR for the yoast.com Platform we needed to modify the dateModified value based on an ACF field, but that's not the point.
It appears all the various Schema implementations in the Yoast SEO plugin always use UTC with no timezone for the datePublished and dateModified. They use a format helper which doesn't do anything about the timezone. I'd like to suggest to consider to use wp_date() to output a timezone value when it's not UTC.
We fixed it for our use case, but only for dateModified. It would be good to consider a fix in the plutin itself.
Step-by-step reproduction instructions
- Go to WP Admin > Settings > General Settings > Timezone, and set a timezone other then UTC. The one on Platform is set to
Amsterdam so it's currently +
- Create a new post and publish it.
- Modify the post and save it.
- On the front end, inspect the schema in the source. The
datePublished and dateModified are present in both the Article and WebPage types.
- Observe the date/time values have a timezone
+00:00
- Expected:
+02:00
Current output example:
"datePublished": "2026-04-01T07:10:34+00:00",
"dateModified": "2026-04-07T12:00:00+00:00",
Expected:
"datePublished": "2026-04-01T07:10:34+02:00",
"dateModified": "2026-04-07T12:00:00+02:00",
Suggest to test with other timezone values set in the WP admin, including 'exotic' values e.g.:
Expected results
- The date/time values to have the correct timezone
Actual results
- it;s awlays UTC +00:00
Screenshots, screen recording, code snippet
No response
Which editor is affected (or editors)
Which browser is affected (or browsers)
Device you are using
No response
Operating system
No response
PHP version
No response
WordPress version
6.9.4
WordPress Theme
No response
Yoast SEO version
trunk
Gutenberg plugin version (if relevant)
No response
Elementor plugin version (if relevant)
No response
Classic Editor plugin version (if relevant)
No response
Relevant plugins in case of a bug
No response
Prerequisites
Please give us a description of what happened
Discovered after a Copilot review, see https://github.com/Yoast/Platform/pull/4325#discussion_r3063025239
In that PR for the yoast.com Platform we needed to modify the
dateModifiedvalue based on an ACF field, but that's not the point.It appears all the various Schema implementations in the Yoast SEO plugin always use UTC with no timezone for the
datePublishedanddateModified. They use a format helper which doesn't do anything about the timezone. I'd like to suggest to consider to usewp_date()to output a timezone value when it's not UTC.We fixed it for our use case, but only for
dateModified. It would be good to consider a fix in the plutin itself.Step-by-step reproduction instructions
Amsterdamso it's currently +datePublishedanddateModifiedare present in both the Article and WebPage types.+00:00+02:00Current output example:
Expected:
Suggest to test with other timezone values set in the WP admin, including 'exotic' values e.g.:
Expected results
Actual results
Screenshots, screen recording, code snippet
No response
Which editor is affected (or editors)
Which browser is affected (or browsers)
Device you are using
No response
Operating system
No response
PHP version
No response
WordPress version
6.9.4
WordPress Theme
No response
Yoast SEO version
trunk
Gutenberg plugin version (if relevant)
No response
Elementor plugin version (if relevant)
No response
Classic Editor plugin version (if relevant)
No response
Relevant plugins in case of a bug
No response