wordpress-seo
wordpress-seo copied to clipboard
Add schema support for FSE templates
Moved from: https://yoast.atlassian.net/browse/PC-761 Reporter: @leonidasmi
Description
When we add blocks that add schema, in a FSE template, that isn’t considered when we output the frontend of a post of that template. Example:
- Go to the Site Editor and edit the Post template
- Add a
Yoast How-toblock in the Post template and save - Create a post and check its schema
- In the schema no
HowToobject is being output
We need to make sure we add support for that
Replicated both with WP 6.0.2 and 6.1 - with the Twenty Twenty-Two theme (which is a FSE theme)
Comment from Lars van Rhijn:
We need to adjust the
getfunction inmeta-tags-context-memoizer.phpto also include the template blocks inside the$blocksvariable. We might also need to change other schema generators that use the post content to generate their schema (such asfaq.php).There is only one problem, there is currently no nice way to request the template that is being rendered within WordPress. We might need to use
resolve_block_templatebut this function is marked as private. We could also use$_wp_current_template_contentbut this global variable is also marked as being private.
+1 https://wordpress.org/support/topic/faq-block-added-but-faq-schema-not-showing-up/
Maybe introducing a filter to allow modifying the context/content can be a partial and temporary solution.
@monbauza, is there an update on this?
@asafm7 Thank you for reaching out to us! I'm sorry to let you know that the issue is not yet fixed.
Our product team will assess the severity of the issue and assign a priority level to the report. Our developers work on the highest priority issues first. We cannot give you an estimate of when they'll start working on the issue.
We will keep you posted with further updates once available.
Thanks.