You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But I've noticed this is not always the case, in the output schema there are places where special characters are not unicode encoded. For example yoast_head_json.og_title and yoast_head_json.WebPage.name, so the & is output like below:
But at the same time BreadcrumbList.ListItem.name and Question.name are unicode encoded. So the output is inconsistent.
Meta data
The same goes for meta data. The og:data, <title> and meta desc do not encode text the same. For example, yoast_head_json.og_description is not unicode encoded. But the og:description in "yoast_head" is.
How can we reproduce this behavior?
Add a special character to the title of a blogpost
Check the wp-json response of that blogpost, namely the "yoast_head_json" part of the response
The text was updated successfully, but these errors were encountered:
Telsenome
changed the title
The json-ld output is not consistent in terms of whether special characters should be unicode encoded or not
The Yoast schema output is inconsistent in terms of unicode encoding special characters or not
Apr 6, 2022
@Djennez Not sure if inconsistency in the schema output actually matters, but thought I should let you know. What would you say, should all entries in the json-ld be encoded the same or doesn't it matter?
I don't think it matters. Since schema is meant for computerized consumption it'll get properly decoded on the parsing end anyway, before any human reads it. It might be a bit annoying for debugging purposes I suppose.
JSON-LD output
In most places in the structured data schema special characters are unicode encoded in the json-ld output.
https://imgur.com/a/Vag0UDu
https://imgur.com/a/Dst6f9f
But I've noticed this is not always the case, in the output schema there are places where special characters are not unicode encoded. For example yoast_head_json.og_title and yoast_head_json.WebPage.name, so the
&
is output like below:"og_title": "Question & answers"
{
"@type": "WebPage",
name": "Question & answers"
}
But at the same time BreadcrumbList.ListItem.name and Question.name are unicode encoded. So the output is inconsistent.
Meta data
The same goes for meta data. The og:data, <title> and meta desc do not encode text the same. For example, yoast_head_json.og_description is not unicode encoded. But the og:description in "yoast_head" is.
How can we reproduce this behavior?
The text was updated successfully, but these errors were encountered: