ashhitch / wp-graphql-yoast-seo

This is an extension to the WPGraphQL plugin for Yoast SEO
GNU General Public License v3.0
225 stars 48 forks source link

Canonical Returns Nothing #139

Closed jhochgrevetsd closed 2 years ago

jhochgrevetsd commented 2 years ago

I have added canonical tags to Yoast and have added the canonical call to my Graph, but it still returns an empty string no matter what I do. Here is my SEO call:

seo { opengraphImage { sourceUrl } title metaDesc canonical schema { raw } }

jhochgrevetsd commented 2 years ago

I just saw that these will not be returned unless we have our WordPress instance set to allow search engines. Might I suggest somehow allowing this? We utilize this plugin for headless WordPress websites and had an issue with search engines indexing the WordPress instance (on a different domain).

chawax commented 2 years ago

Same problem for me, need it for headless Wordpress too :(

ashhitch commented 2 years ago

Yeah, as mentioned before, this is standard in Yoast and is passed back from their methods.

I also use this in a headless environment; some users will want to use all these settings as they are now.

What I normally do is have my own robots.txt or index.php which the setting to make sure the admin is not indexed

chawax commented 2 years ago

I had misunderstood your response but that makes sense : il a content should not be indexed, you don't need canonical url ! Thanks for helping.