-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yoast is outputting invalid JSON-LD URIs for the @id
tag in Schema entity output
#21445
Comments
Hi @webstackdev Thanks for using the Yoast SEO plugin and also for creating the issue. I tried to replicate this by creating multiple sites using InstaWP and WP Local, checked the REST API, and noticed that the FYI, I tested with the latest versions of WordPress 6.5.4 and Yoast SEO 22.9 (released today). I also checked the REST API URL of our website, which is mentioned in our developer documentation over here and also confirmed that the So, can you please perform a conflict check on your staging site to find out which plugin or whether any server rules are adding this trailing slash or not? We look forward to hearing from you and are happy to help you. |
@josevarghese thank you, I'll investigate further on our end |
@josevarghese @webstackdev I believe that in this instance the trailing slash is wanted in all cases except when there are anchor tags present and URL params. It makes sense to add a trailing slash by default for sites that redirect from non-trailing slash to trailing slash. In this case though trailing slash should not appear after URL params and anchor links. For Example:
Should be:
We're seeing trailing slash appended to all URL's regardless of if they contain search params or anchors. |
Hi @mrispoli24 Thanks for the comment. Regarding |
@josevarghese I think we resolved it, thank you for your help. |
Good to hear that the issue is fixed. If you can share details on how you have fixed it, it would be helpful for users checking this issue. Have a great day! |
Please give us a description of what happened
I am working on a site that uses trailing slashes after all URLs, for example
https://example.com/blog/my-article-slug/
. The project uses WordPress as a headless CMS, and a static site generate fetching data via the WP REST API. The trailing slashes are added by the hosting platform (Vercel, via the"trailingSlash": true
option in the project config). They are also added in WP'sSettings
->Permalink Settings
options for blog articles (/blog/%postname%/
). We also have an optional category base set in Permalinks (blog/categories
) that follows a different pattern (no trailing slash, in either case they're both normalized by Vercel).We are currently getting the following output for the
@id
field of the outputted JSON-LD from Yoast (yoast_head
):URI fragments and query parameters should not be followed by a slash per the specs, to the best of my understanding. I included the details about our setup to be able to share the Permalink settings and make sense. I can update with any relevant Yoast settings; I did not see any that appear directly related to this besides setting the type of content for a page in the Yoast WP UI panel.
Expected results
I'm not sure what this should be:
https://example.com/#/schema/logo/image/
Technical info
JSON-LD graph objects (including
@id
) are JSON-LD node objects. Their value must be of type IRI or compact IRI. A trailing slash after the path pattern is not allowed (RFC 3987 section).Used versions
The text was updated successfully, but these errors were encountered: