๐จ NOTE: This is prerelease software. ๐จ
Adds WPGraphQL support for Rank Math SEO. Built with WPGraphQL Plugin Boilerplate.
- PHP 7.4+ || 8.0+ || 8.1+
- WordPress 5.4.1+
- WPGraphQL 1.8.1+
- RankMath SEO 1.0.90+
- Install & activate WPGraphQL.
- Install & activate Rank Math SEO.
- Download the latest release
.zip
file, upload it to your WordPress install, and activate the plugin.
composer require axepress/wp-graphql-rank-math
As we work towards a 1.0 Release, we will need to introduce numerous breaking changes. We will do our best to group multiple breaking changes together in a single release, to make it easier on developers to keep their projects up-to-date.
Until we hit v1.0, we're using a modified version of SemVer, where:
- v0.x: "Major" releases. These releases introduce new features, and may contain breaking changes to either the PHP API or the GraphQL schema
- v0.x.y: "Minor" releases. These releases introduce new features and enhancements and address bugs. They do not contain breaking changes.
- v0.x.y.z: "Patch" releases. These releases are reserved for addressing issue with the previous release only.
Development of WPGraphQL for Rank Math SEO is provided by AxePress Development. Community contributions are welcome and encouraged.
Basic support is provided for free, both in this repo and at the #rank-math channel in WPGraphQL Slack.
Priority support and custom development is available to our Sponsors.
- General Settings
- Titles & Meta Settings
- ๐ SEO data for
- Single posts, pages, attachments, and CPTs.
- Post Type archives.
- Categories, tags, and custom taxonomy terms.
- Authors (users)
- Image attributes.
- Sitemaps
- Redirections
- 404 Monitor
- Local SEO and Knowledgegraph
- RSS Feeds
- Full head
- RankMath SEO Score
- Basic Meta Attributes: Title, Description, Robots, Focus Keywords, Canonical URL,
- Breadcrumbs
- ๐ JSON-LD
- Raw schema
- Individual JSON-LD attributes
- OpenGraph & Twitter
Note This is not a complete list of GraphQL fields and types added to the schema. Please refer to the WPGraph_i_QL IDE for more queries and their documentation.
query MyPosts {
posts {
nodes {
databaseId
title
seo { # The SEO data for the current post object.
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
openGraph {
articleMeta {
section
}
description
locale
siteName
title
type
url
slackEnhancedData {
data
label
}
twitterMeta {
card
description
title
}
}
robots
title
... on RankMathContentNodeSeo { # Only available on `contentNode` types.
isPillarContent
seoScore {
badgeHtml
hasFrontendScore
rating
score
}
}
}
author {
node {
seo { # The SEO Data for the post object's author.
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
robots
title
}
}
}
categories {
nodes {
name
seo { # The SEO Data for the post's associated terms.
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
openGraph {
locale
siteName
type
url
twitterMeta {
card
}
}
robots
title
}
}
}
}
}
}
{
contentTypes {
nodes {
name
seo { # The SEO data for the post type archive
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
openGraph {
locale
siteName
type
url
twitterMeta {
card
}
}
robots
title
}
contentNodes {
nodes {
seo { # The SEO data for the associated posts.
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
openGraph {
articleMeta {
section
}
description
locale
siteName
title
type
url
slackEnhancedData {
data
label
}
twitterMeta {
card
description
title
}
}
robots
title
... on RankMathContentNodeSeo { # Only available on `contentNode` types.
isPillarContent
seoScore {
badgeHtml
hasFrontendScore
rating
score
}
}
}
}
}
}
}
}
query MyCategories {
categories {
nodes {
name
seo { # The SEO data for the current term archive
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
openGraph {
locale
siteName
type
url
twitterMeta {
card
}
}
robots
title
}
contentNodes {
nodes {
databaseId
title
seo { ## The SEO data for the posts associated with this term.
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
openGraph {
articleMeta {
section
}
description
locale
siteName
title
type
url
slackEnhancedData {
data
label
}
twitterMeta {
card
description
title
}
}
robots
title
... on RankMathContentNodeSeo { # Only available on `contentNode` types.
isPillarContent
seoScore {
badgeHtml
hasFrontendScore
rating
score
}
}
}
}
}
}
}
}
{
users {
nodes {
name
seo { # The SEO data for the User profile page.
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
robots
title
}
}
}
}
query MyNodeByUriQuery( $uri: String ) {
nodeByUri( uri: $uri ) {
... on NodeWithRankMathSeo {
seo {
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
robots
title
... on RankMathContentNodeSeo {
isPillarContent
seoScore {
score
}
}
}
}
}
}
{
rankMathSettings {
sitemap {
author {
excludedRoles
excludedUserDatabaseIds
sitemapUrl
connectedAuthors {
nodes {
id
}
}
}
contentTypes {
customImageMetaKeys
isInSitemap
sitemapUrl
type
connectedContentNodes {
nodes {
uri
}
}
}
general {
canPingSearchEngines
excludedPostDatabaseIds
excludedTermDatabaseIds
hasFeaturedImage
hasImages
linksPerSitemap
}
indexUrl
taxonomies {
hasEmptyTerms
isInSitemap
sitemapUrl
type
connectedAuthors {
nodes {
uri
}
}
}
}
}
}
- Update your
.env
file to your testing environment specifications. - Run
composer install-test-env
to create the test environment. - Run your test suite with Codeception.
E.g.
vendor/bin/codecept run wpunit
will run all WPUnit tests.