PHPackages                             ashhitch/wp-graphql-yoast-seo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ashhitch/wp-graphql-yoast-seo

ActiveWordpress-plugin[API Development](/categories/api)

ashhitch/wp-graphql-yoast-seo
=============================

Query Yoast SEO data with wp-graphql

v5.0.2(5mo ago)231214.7k↓35%48[20 issues](https://github.com/ashhitch/wp-graphql-yoast-seo/issues)[4 PRs](https://github.com/ashhitch/wp-graphql-yoast-seo/pulls)GPL-3.0-or-laterPHPCI failing

Since Nov 11Pushed 3w ago8 watchersCompare

[ Source](https://github.com/ashhitch/wp-graphql-yoast-seo)[ Packagist](https://packagist.org/packages/ashhitch/wp-graphql-yoast-seo)[ Fund](https://www.buymeacoffee.com/ashhitch)[ GitHub Sponsors](https://github.com/ashhitch)[ RSS](/packages/ashhitch-wp-graphql-yoast-seo/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (5)Versions (100)Used By (0)

WPGraphQl Yoast SEO Plugin
==========================

[](#wpgraphql-yoast-seo-plugin)

[![Latest Stable Version](https://camo.githubusercontent.com/640d79164a15f5c1d94106fb3c11ebb7600e7e7bd2f84d3d4e6d6c7f4eb90427/68747470733a2f2f706f7365722e707567782e6f72672f61736868697463682f77702d6772617068716c2d796f6173742d73656f2f762f737461626c65)](https://packagist.org/packages/ashhitch/wp-graphql-yoast-seo)[![Total Downloads](https://camo.githubusercontent.com/5adbf508a75d404a050b9894815ffec5f9159ff05d80341b03f07ee94b866768/68747470733a2f2f706f7365722e707567782e6f72672f61736868697463682f77702d6772617068716c2d796f6173742d73656f2f646f776e6c6f616473)](https://packagist.org/packages/ashhitch/wp-graphql-yoast-seo)[![Monthly Downloads](https://camo.githubusercontent.com/7f95e76733bc023d068ba463fee733c704966ba9006a1f4590d9d098777cf0dd/68747470733a2f2f706f7365722e707567782e6f72672f61736868697463682f77702d6772617068716c2d796f6173742d73656f2f642f6d6f6e74686c79)](https://packagist.org/packages/ashhitch/wp-graphql-yoast-seo)

[![WPGraphQl Yoast SEO Plugin](./banner.png)](./banner.png)

Please note version 4 of the Yoast Plugin is a major update.
------------------------------------------------------------

[](#please-note-version-4-of-the-yoast-plugin-is-a-major-update)

If you are stuck on version of Yoast before V4 then use v3 of this plugin.

This is an extension to the WPGraphQL plugin () that returns Yoast SEO data.

> Using this plugin? I would love to see what you make with it. 😃 [@ash\_hitchcock](https://twitter.com/ash_hitchcock)

**Currently returning SEO data for:**

- Pages
- Posts
- Custom post types
- Products (WooCommerce)
- Categories
- Custom taxonomies
- WooCommerce Products
- Yoast Configuration
    - Webmaster verification
    - Social profiles
    - Schemas
    - Breadcrumbs

> If there is any Yoast data that is not currently returned, please raise an issue so we can add it to the roadmap.

Quick Install
-------------

[](#quick-install)

- Install from the [WordPress Plugin Directory](https://wordpress.org/plugins/add-wpgraphql-seo/)
- Clone or download the zip of this repository into your WordPress plugin directory &amp; activate the **WP GraphQL Yoast SEO** plugin
- Install &amp; activate [WPGraphQL](https://www.wpgraphql.com/)

Composer
--------

[](#composer)

```
composer require ashhitch/wp-graphql-yoast-seo

```

Contributor Setup
-----------------

[](#contributor-setup)

This plugin uses Docker for local development to ensure a consistent environment for all contributors.

### Prerequisites

[](#prerequisites)

Before you begin, make sure you have installed:

1. [Docker](https://www.docker.com/get-started)
2. [Docker Compose](https://docs.docker.com/compose/install/) (usually included with Docker Desktop)
3. Git

### Getting Started

[](#getting-started)

1. **Clone the repository**:

    ```
    git clone https://github.com/ashhitch/wp-graphql-yoast-seo.git
    cd wp-graphql-yoast-seo
    ```
2. **Start the Docker environment**:

    ```
    docker-compose up -d
    ```

    This will build and start the following containers:

    - WordPress (accessible at )
    - MySQL database
    - phpMyAdmin (accessible at )
3. **Access WordPress**:

    The setup script will automatically:

    - Install WordPress
    - Install and activate the WPGraphQL plugin
    - Install and activate the Yoast SEO plugin
    - Activate the wp-graphql-yoast-seo plugin
    - Create some test content (posts and pages)

    Default credentials:

    - Admin Username: `admin`
    - Admin Password: `password`
    - Admin Email: `admin@example.com`

### Development Workflow

[](#development-workflow)

1. **Make your code changes** to the plugin files in your local repository.
2. **Test your changes**:

    - Visit  to access the WordPress admin
    - You can use tools like [GraphiQL](https://github.com/wp-graphql/wp-graphql) (included with WPGraphQL) to test your GraphQL queries
3. **Restart containers if needed**:

    ```
    docker-compose restart
    ```
4. **View logs**:

    ```
    docker-compose logs -f wordpress
    ```
5. **Stop the environment** when you're done:

    ```
    docker-compose down
    ```

    To completely remove volumes (database data) as well:

    ```
    docker-compose down -v
    ```

### Coding Standards

[](#coding-standards)

This plugin follows WordPress Coding Standards. Before submitting a pull request:

1. **Install development dependencies**:

    ```
    composer install
    ```
2. **Run code quality checks**:

    ```
    composer run phpcs
    ```
3. **Fix coding standards automatically** (when possible):

    ```
    composer run phpcbf
    ```

### GraphQL Testing

[](#graphql-testing)

To test your GraphQL queries with the WPGraphQL Yoast SEO plugin:

1. Access the GraphiQL interface at
2. Try some of the example queries from the Usage section below

### Troubleshooting

[](#troubleshooting)

If you encounter issues:

1. **Check container status**:

    ```
    docker-compose ps
    ```
2. **Rebuild containers**:

    ```
    docker-compose down
    docker-compose build --no-cache
    docker-compose up -d
    ```
3. **Check WordPress logs**:

    ```
    docker-compose logs wordpress
    ```

Find this useful?
-----------------

[](#find-this-useful)

[![Buy Me A Coffee](https://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/ashhitch)

Canonicals
----------

[](#canonicals)

> Please note canonicals will not be returned if you have the discourage search engines option turned on in your WordPress settings.

V4 breaking change
------------------

[](#v4-breaking-change)

Plugin now requires at least Yoast 14.0.0

V3 breaking change
------------------

[](#v3-breaking-change)

Image urls are now returned as `mediaItem` type.

This applies to `twitterImage` and `opengraphImage`

Usage with Gatsby
-----------------

[](#usage-with-gatsby)

Checkout the companion [Gatsby plugin](https://github.com/ashhitch/gatsby-plugin-wpgraphql-seo) to add in Metadata and JSON LD schema with ease.

Usage
-----

[](#usage)

To query for the Yoast Data simply add the seo object to your query:

### Post Type Data

[](#post-type-data)

```
query GetPages {
    pages(first: 10) {
        edges {
            node {
                id
                title
                seo {
                    canonical
                    title
                    metaDesc
                    focuskw
                    metaRobotsNoindex
                    metaRobotsNofollow
                    opengraphAuthor
                    opengraphDescription
                    opengraphTitle
                    opengraphDescription
                    opengraphImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    opengraphUrl
                    opengraphSiteName
                    opengraphPublishedTime
                    opengraphModifiedTime
                    twitterTitle
                    twitterDescription
                    twitterImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    breadcrumbs {
                        url
                        text
                    }
                    cornerstone
                    schema {
                        pageType
                        articleType
                        raw
                    }
                    readingTime
                    fullHead
                }
                author {
                    node {
                        seo {
                            metaDesc
                            metaRobotsNofollow
                            metaRobotsNoindex
                            title
                            social {
                                youTube
                                wikipedia
                                twitter
                                soundCloud
                                pinterest
                                mySpace
                                linkedIn
                                instagram
                                facebook
                            }
                        }
                    }
                }
            }
        }
    }
}
```

### Post Taxonomy Data

[](#post-taxonomy-data)

```
query GetCategories {
    categories(first: 10) {
        edges {
            node {
                id
                seo {
                    fullHead
                    canonical
                    title
                    metaDesc
                    focuskw
                    metaRobotsNoindex
                    metaRobotsNofollow
                    opengraphAuthor
                    opengraphDescription
                    opengraphTitle
                    opengraphDescription
                    opengraphImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    twitterTitle
                    twitterDescription
                    twitterImage {
                        altText
                        sourceUrl
                        srcSet
                    }
                    breadcrumbs {
                        url
                        text
                    }
                }
                name
            }
        }
    }
}
```

### User Data

[](#user-data)

```
query GetUsers {
    users {
        nodes {
            seo {
                metaDesc
                metaRobotsNofollow
                metaRobotsNoindex
                title
                fullHead
                social {
                    youTube
                    wikipedia
                    twitter
                    soundCloud
                    pinterest
                    mySpace
                    linkedIn
                    instagram
                    facebook
                }
            }
        }
    }
}
```

### Edge and Page Info Data

[](#edge-and-page-info-data)

```
query GetPostsWithIsPrimary {
    posts {
        pageInfo {
            startCursor
            seo {
                schema {
                    raw
                }
            }
        }
        nodes {
            title
            slug
            categories {
                edges {
                    isPrimary
                    node {
                        name
                        count
                    }
                }
            }
        }
    }
}
```

### Yoast Config Data

[](#yoast-config-data)

```
query GetSeoConfig {
    seo {
        meta {
            author {
                description
                title
            }
            date {
                description
                title
            }
            config {
                separator
            }
            homepage {
                description
                title
            }
            notFound {
                breadcrumb
                title
            }
        }
        webmaster {
            googleVerify
            yandexVerify
            msVerify
            baiduVerify
        }
        schema {
            siteName
            wordpressSiteName
            siteUrl
            inLanguage
            companyName
            companyOrPerson
            companyLogo {
                mediaItemUrl
            }
            logo {
                mediaItemUrl
            }
            personLogo {
                mediaItemUrl
            }
        }
        breadcrumbs {
            showBlogPage
            separator
            searchPrefix
            prefix
            homeText
            enabled
            boldLast
            archivePrefix
            notFoundText
        }
        social {
            facebook {
                url
                defaultImage {
                    mediaItemUrl
                }
            }
            instagram {
                url
            }
            linkedIn {
                url
            }
            mySpace {
                url
            }
            pinterest {
                url
                metaTag
            }
            twitter {
                cardType
                username
            }
            wikipedia {
                url
            }
            youTube {
                url
            }
            otherSocials
        }
        openGraph {
            frontPage {
                title
                description
                image {
                    altText
                    sourceUrl
                    mediaItemUrl
                }
            }
            defaultImage {
                altText
                sourceUrl
                mediaItemUrl
            }
        }
        contentTypes {
            post {
                title
                schemaType
                metaRobotsNoindex
                metaDesc
                schema {
                    raw
                }

                archive {
                    fullHead
                    archiveLink
                    breadcrumbTitle
                    hasArchive
                    metaDesc
                    metaRobotsNoindex
                    title
                }
            }
            page {
                metaDesc
                metaRobotsNoindex
                schemaType
                title
                schema {
                    raw
                }
            }
        }
        redirects {
            origin
            target
            format
            type
        }
    }
}
```

### contentNode and nodeByUri

[](#contentnode-and-nodebyuri)

```
contentNode(id: "1", idType: DATABASE_ID) {
    id
    contentTypeName
    seo {
      title
      metaDesc
    }
  }
  node(id: "cG9zdDox",) {
    ... on NodeWithTitle {
      seo {
        title
        metaDesc
      }
    }

  }
  nodeByUri(uri: "/") {
    ... on NodeWithTitle {
      seo {
        title
        metaDesc
      }
    }
  }
```

Support
-------

[](#support)

[Open an issue](https://github.com/ashhitch/wp-graphql-yoast-seo/issues)

[Twitter: @ash\_hitchcock](https://twitter.com/ash_hitchcock)

> Please Note: Yoast and WPGraphQL and their logos are copyright to their respective owners.

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity53

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 81.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~38 days

Recently: every ~103 days

Total

61

Last Release

150d ago

Major Versions

v2.1.0 → v3.0.02019-12-01

v2.2.0 → v3.0.12019-12-03

v3.3.0 → v4.0.0Alpha2020-04-30

v4.23.2 → v5.0.02025-09-19

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2438290?v=4)[Ash Hitchcock](/maintainers/ashhitch)[@ashhitch](https://github.com/ashhitch)

---

Top Contributors

[![ashhitch](https://avatars.githubusercontent.com/u/2438290?v=4)](https://github.com/ashhitch "ashhitch (154 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![BronsonQuick](https://avatars.githubusercontent.com/u/1377956?v=4)](https://github.com/BronsonQuick "BronsonQuick (2 commits)")[![rodrigo-arias](https://avatars.githubusercontent.com/u/11416255?v=4)](https://github.com/rodrigo-arias "rodrigo-arias (2 commits)")[![izzygld](https://avatars.githubusercontent.com/u/12534341?v=4)](https://github.com/izzygld "izzygld (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![gregrickaby](https://avatars.githubusercontent.com/u/200280?v=4)](https://github.com/gregrickaby "gregrickaby (1 commits)")[![henrikwirth](https://avatars.githubusercontent.com/u/10786260?v=4)](https://github.com/henrikwirth "henrikwirth (1 commits)")[![heyjones](https://avatars.githubusercontent.com/u/600859?v=4)](https://github.com/heyjones "heyjones (1 commits)")[![jasonbahl](https://avatars.githubusercontent.com/u/1260765?v=4)](https://github.com/jasonbahl "jasonbahl (1 commits)")[![jonshipman](https://avatars.githubusercontent.com/u/12699954?v=4)](https://github.com/jonshipman "jonshipman (1 commits)")[![kent1D](https://avatars.githubusercontent.com/u/178744?v=4)](https://github.com/kent1D "kent1D (1 commits)")[![kuuak](https://avatars.githubusercontent.com/u/6989959?v=4)](https://github.com/kuuak "kuuak (1 commits)")[![LiahMartens](https://avatars.githubusercontent.com/u/5265324?v=4)](https://github.com/LiahMartens "LiahMartens (1 commits)")[![matepaiva](https://avatars.githubusercontent.com/u/9984086?v=4)](https://github.com/matepaiva "matepaiva (1 commits)")[![matthewgrzegorczyk](https://avatars.githubusercontent.com/u/9909232?v=4)](https://github.com/matthewgrzegorczyk "matthewgrzegorczyk (1 commits)")[![pascalroget](https://avatars.githubusercontent.com/u/18585190?v=4)](https://github.com/pascalroget "pascalroget (1 commits)")[![renatonascalves](https://avatars.githubusercontent.com/u/19148962?v=4)](https://github.com/renatonascalves "renatonascalves (1 commits)")[![saleebm](https://avatars.githubusercontent.com/u/34875122?v=4)](https://github.com/saleebm "saleebm (1 commits)")[![amanda-t](https://avatars.githubusercontent.com/u/1373926?v=4)](https://github.com/amanda-t "amanda-t (1 commits)")

---

Tags

graphqlhacktoberfestwordpresswordpress-pluginwpgraphql-pluginyoast-seo

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ashhitch-wp-graphql-yoast-seo/health.svg)

```
[![Health](https://phpackages.com/badges/ashhitch-wp-graphql-yoast-seo/health.svg)](https://phpackages.com/packages/ashhitch-wp-graphql-yoast-seo)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[humanmade/coding-standards

Human Made Coding Standards

160443.1k59](/packages/humanmade-coding-standards)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)[infinum/eightshift-coding-standards

Eightshift WordPress Coding Standards

1790.9k6](/packages/infinum-eightshift-coding-standards)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
