Skip to content

Enabled schema in the RM dashboard ruins FE builds #114

@floretsky

Description

@floretsky

Description

Hello!

I encountered a problem with the schema (Structured Data) setting enabled in the RM dashboard:

Image

I have been chatting with the RM developers about it and they have suggested to implement a fix which didn't fix it for me.

The code that is ruining the builds is located under \plugins\seo-by-rank-math\includes\modules\schema\class-snippet-shortcode.php
It's not a part of the wp-graphql-rank-math plugin, but seems like this part of code is running multiple times because wp-graphql-rank-math creates an instance of RM which runs this code part multiple times and throws Internal Server Error

Steps to reproduce

My website build is based on the stack which includes faustjs, sage theme and bedrock
WPGraphQL Query I'm running is

fragment SEOInformationFragment on NodeWithRankMathSeo {
      seo { 
        fullHead
        breadcrumbTitle
        breadcrumbs {
          text
          url
          isHidden
        }
        canonicalUrl
        description
        focusKeywords
        jsonLd {
          raw
        }
        robots
        title
        openGraph {
          articleMeta {
            section
          }
          description
          locale
          siteName
          title
          type
          url
          slackEnhancedData {
            data
            label
          }
          twitterMeta {
            card
            description
            title
          }
        }
      }
    }

Let me know if I can provide any more additional helpful information. Thank you!

Additional context

No response

Plugin Version

0.3.2

WordPress Version

6.6.2

WPGraphQL Version

1.29.0

RankMath SEO Version

1.0.232

Additional enviornmental details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions