Gatsby & WordPress - 2.7. - Yoast SEO and WPGraphQL

by Jack Pritchard

Hey! This post's a little over two years old now, so some of what's here might be out of date. Still worth a read, but if anything really matters to you, it's worth double-checking against a newer source too.

In this short video, we cover the core concepts of what Yoast SEO provides us to our schema and how we can access the Yoast SEO fields using a GraphQL query.

SEO is of major importance in any modern website application and we don't want to lose the benefits that we would get over a traditional WordPress setup.

By using the Yoast SEO plugin and WPGraphQL Yoast plugin we can import the data into our Gatsby application to generate HTML head tags in our custom SEO React component.

The separate WPGraphQL Yoast SEO addon used here has changed since 2019 — check its current status and setup instructions before relying on this approach.