axewp / wp-graphql-rank-math Goto Github PK
View Code? Open in Web Editor NEWAdd GraphQL support for RankMath SEO
License: GNU General Public License v3.0
Add GraphQL support for RankMath SEO
License: GNU General Public License v3.0
While #52 adds the ability to query for redirections from the schema, querying for the redirected URI doesn't fetch the redirected object. This is because the Rank Math Redirector
class (like most of the plugin) only operates on the global query/request.
We need to filter graphql_pre_resolve_uri
and check if the provided URI matches any redirections.
This will either require a change in Rank Math core or a local shim of the entire Redirector class.
The existing approach is to use frontend redirects (e.g. https://nextjs.org/docs/pages/api-reference/next-config-js/redirects).
Something that needs to be solved is how/where to send redirects that are not ContentNode
types. See #2491
When different URLS are used for Wp Adress URL and site adress the data being returned no longer aligns with the WPGRAPHQL Ide
Create a backend on a subdomain.
Wp Adress URL should be backend subdomain. ie backend.sitename.com
Site Adress should be set to a different frontend site adress.
Create a custom post type. + a custom taxonomy for that post type. Enable Rankmath and set posts to no index.
Run Queries for SEO data. Meta Robots. Notice that the data being returned is wrong. Although it shows no-index in the WPGRAPHQL ide. The frontend says index for everything.
The only thing that fixes this issue is changing both urls to the same. Although this is not an acceptable solution to the problem as the frontend URL needs to be different in my use case and other headless use cases.
The same goes for the other data such as breadcrumbs, title etc. Other page data related to the Rankmath SEO query is also missing, some is there though(graphql IDE) but when queried it will show incorrect data on the frontend.
Example
"canonicalUrl": null,
"robots": [
"follow",
"noindex"
],
The frontend data will show something different.
No response
0.0.7 and others
WordPress 6.1.1 running Twenty Twenty-One theme.
Version 1.13.7
Version 1.0.103.1 + pro Version 3.0.25
Running on next.js with apollo client
While it may be obvious that Rank Math and Yoast SEO cannot coexist, the plugin is unfortunately slugged add-wpgraphql-seo
. This can and has caused confusion about the true purpose of that plugin and whether it can be installed alongside (or if it may even be a prerequeste for) WPGraphQL for RankMath SEO.
Disable the plugin and add an admin_notice
when wp-graphql-yoast-seo
is installed.
No response
h/t @alexkey89
Currently only the raw
block of properties gets returned. We should be able to represent the individual properties on the GraphQL schema.
I'm able to get seo field on WordPress GraphQL IDE. But on gatsby develop giving this error.
Getting this Error: GraphQL request was redirected to /
WPGraphQL for Rank Math SEO Version 0.0.5
6.0.3
1.12.0
1.0.100.1
"react": "^18.1.0",
"gatsby": "^4.19.2",
"gatsby-source-wordpress": "^6.24.0",
{
resolve: gatsby-source-wordpress
,
options: {
schema: {
timeout: 100000,
},
url: https://cliniexpertsresearch.net/graphql
,
}
},
Hi all, I am trying get robots meta data in rank math wpgraphql plugin, but seems like all results showing noindex and nofollow for all pages and posts. I check in my rank match setting, and almost all pages have index property, still wpgraphql showing noindex and nofollow
Go to graphql IDE, and add this query:
query myQuery {
contentNodes(first: 999) {
edges {
node {
seo {
robots
}
}
}
}
}
I disabled discourage search enginer in settings > reading, but still it is showing noindex and nofollow
0.0.11
6.1.1
1.14.0
1.0.110.2
No response
Uncaught Error: Interface "AxeWP\GraphQL\Interfaces\Hookable" not found
Fatal error: Uncaught Error: Interface "AxeWP\GraphQL\Interfaces\Hookable" not found
in /var/www/html/wp-content/plugins/wp-graphql-rank-math-develop/src/CoreSchemaFilters.php on line 16
Call stack:
include()
wp-content/plugins/ame-branding-add-on/vendor/composer/ClassLoader.php:480
Composer\A\includeFile()
wp-content/plugins/ame-branding-add-on/vendor/composer/ClassLoader.php:346
Composer\A\ClassLoader::loadClass()
wp-content/plugins/wp-graphql-rank-math-develop/src/Main.php:79
WPGraphQL\R\Main::setup()
wp-content/plugins/wp-graphql-rank-math-develop/src/Main.php:38
WPGraphQL\R\Main::instance()
wp-content/plugins/wp-graphql-rank-math-develop/wp-graphql-rank-math.php:108
graphql_seo_init()
wp-includes/class-wp-hook.php:307
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:331
WP_Hook::do_action()
wp-includes/plugin.php:476
do_action()
wp-content/plugins/wp-graphql/src/WPGraphQL.php:256
WPGraphQL::{closure}()
wp-includes/class-wp-hook.php:307
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:331
WP_Hook::do_action()
wp-includes/plugin.php:476
do_action()
wp-settings.php:576
require_once()
wp-config.php:133
require_once()
wp-load.php:50
require_once()
wp-admin/admin.php:34
require_once()
wp-admin/plugins.php:10
Query Monitor
No response
0.0.2
6.0.1
1.8.6
PHP 8.1
We should write a quick tutorial / example repo for using the plugin on the frontend.
E.g. using NextSEO.
We should add documentation for the existing plugin actions and filters.
When getting the values from the GraphQL, the titles and descriptions with HTML entities (such as β and &) are rendered as –
and &
respectively.
I think the plugin should display them ready-to-use by the frontend instead of the backend or frontend decoding them.
The obvious solution would be to decode them when passing them to the GraphQL.
An alternative, is to do the decoding myself with RankMath's filters. For example, to decode the SEO title you can simply add these lines of code:
add_filter('rank_math/frontend/title', function ($title) {
return html_entity_decode($title);
});
Nonetheless, I would still prefer that the plugin did this by default.
Let me know if you disagree and why π
No response
It doesn't seem to return SEO for woocommerce products whether if is simple product or variable.
Add support / extend this plugin to support WooCommerce better
YoastSEO already provides graphql support.
No response
https://www.zenbusiness.com/llc/
I did a console log of the openGraph props in Astro: and articleMeta & videoMeta comes with info, but productMeta doesnβt.
This is the schema of one of the pages we are checking:
This is the part of the code always returning empty:
No response
0.0.14
6.3.2
1.19.0
1.0.208.1
No response
Currently ${objectType}.seo
is typed as RankMathSeo
instead of RankMath${ObjectType}Seo
.
This requires you to unnecessarily drill down the interface, like in 53efda5
We should leave the NodeWithSeo
interface to use the RankMathSeo
type, but for all direct connections we should resolve straight to the object. This would reduce complexity on both the query and implementation (i.e. graphql-Codegen) side of this.
Important
This may be a breaking change to implement.
query UserSeo( $id: ID! ) {
user( id: $id, idType: DATABASE_ID ){
databaseId
seo {
fullHead
# this should not be necessary π
... on RankMathUserSeo {
additionalProfiles
facebookProfileUrl
twitterUserName
}
}
}
No response
0.1.0
6.4.3
1.22.0
1.215.1
No response
You can get seo information about post types
.
{
posts {
pageInfo {
seo { // archive data
breadcrumbTitle
canonicalUrl
description
fullHead
isPillarContent
title
}
}
}
}
There is still no way to think of an alternative.
You can set this information in the WordPress Rank-math plugin, but it is a pity that you cannot get it from graphql.
I can't find a way to launch playicon in Watermark options. There is no option to be able to do that. Do you have any solution to fix this situation?
I want to find a solution that can use watermark using graphql
No response
No response
When "ContentType" is returned by a nodeByUri query (for example on the page for posts e.g. "/blog" or woocommerce shop page e.g. "/shop") including "breadcrumbs" under "NodeWithRankMathSeo" produces an internal server error. The data is still returned with the breadcrumbs being null. I suspect breadcrumbs are not actually available on this type?
Example query:
query rankMathNodeByUri {
nodeByUri(uri: "/blog") {
__typename
... on NodeWithRankMathSeo {
seo {
__typename
title
description
breadcrumbs {
text
isHidden
url
}
}
}
}
}
Result:
{
"errors": [
{
"message": "Internal server error",
"extensions": {
"category": "internal"
},
"locations": [
{
"line": 9,
"column": 5
}
],
"path": [
"nodeByUri",
"seo",
"breadcrumbs"
]
}
],
"data": {
"nodeByUri": {
"__typename": "ContentType",
"seo": {
"__typename": "RankMathPostTypeSeo",
"title": "Blog - Website Name",
"description": "Blog page SEO description",
"breadcrumbs": null
}
}
}
}
No response
0.1.1
6.4.3
1.22.1
1.0.216
WooGraph 0.19.0
WooCommerce 8.6.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.