WPGraphQL for Yoast SEO
This FREE plugin from @Ash_Hitchcock exposes data managed by Yoast SEO to the WPGraphQL Schema, allowing for your SEO data to be used in your headless applications.
Community PluginView Plugin on Github
If you are stuck on version of Yoast before V14 then use v3 of this plugin.
This is an extension to the WPGraphQL plugin (https://github.com/wp-graphql/wp-graphql) that returns Yoast SEO data.
Using this plugin? I would love to see what you make with it. 😃 @ash_hitchcock
Currently returning SEO data for:
- Custom post types
- Products (WooCommerce)
- Custom taxonomies
- WooCommerce Products
- Yoast Configuration
- Webmaster verification
- Social profiles
If there is any Yoast data that is not currently returned, please raise an issue so we can add it to the roadmap.
- Install from the WordPress Plugin Directory
- Clone or download the zip of this repository into your WordPress plugin directory & activate the WP GraphQL Yoast SEO plugin
- Install & activate WPGraphQL
Please note canonicals will not be returned if you have the discourage search engines option turned on in your WordPress settings.
Plugin now requires at least Yoast 14.0.0
Image urls are now returned as
This applies to
Checkout the companion Gatsby plugin to add in Metadata and JSON LD schema with ease.
To query for the Yoast Data simply add the seo object to your query:
Please Note: Yoast and WPGraphQL and their logos are copyright to their respective owners.