dafky2000 / wp-graphql-yoast-seo

This is an extension to the WPGraphQL plugin for Yoast SEO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WPGraphQl Yoast SEO Plugin

This is an extension to the WPGraphQL plugin (https://github.com/wp-graphql/wp-graphql) that returns Yoast SEO data.

Currently returning SEO data for pages, posts, custom post types, categories and custom taxonomies.

Using this plugin? I would love to see what you make with it. @ash_hitchcock

Quick Install

  1. Install & activate WPGraphQL
  2. Clone or download the zip of this repository into your WordPress plugin directory & activate the WP GraphQL Yoast SEO plugin

Composer

composer require ashhitch/wp-graphql-yoast-seo

Usage

To query for the Yoast Data as the seo object to your query:

{
  pages(first: 10) {
    edges {
      node {
        id
        title
        seo {
          title
          metaDesc
          focuskw
          metaKeywords
          metaRobotsNoindex
          metaRobotsNofollow
          opengraphTitle
          opengraphDescription
          opengraphImage {
            altText
            sourceUrl
            srcSet
          }
          twitterTitle
          twitterDescription
          twitterImage {
            altText
            sourceUrl
            srcSet
        }
        }
      }
    }
  }
}

V3 breaking change.

Image urls are now returned as mediaItem type.

This applies to twitterImage and opengraphImage

Notes

This can be used in production, however it is still under active development.

Support

Open an issue

About

This is an extension to the WPGraphQL plugin for Yoast SEO

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%