Fatal Error in Rank Math Schema on Specific Product (Post ID 5338)

#1061490
  • Resolved Elahe Irvani
    Rank Math free

    Hello,

    We are encountering a fatal PHP error when editing a specific WooCommerce product (post ID: 5338) with Rank Math enabled. The error does not occur on other products.

    Here is the error from our logs:

    PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-frontend.php on line 73

    Additionally, the Rank Math metabox fails to load on that product edit page, and the browser console logs this error:

    Uncaught TypeError: Cannot read properties of undefined (reading ‘isPrimary’)
    at rank-math-app.js

    We suspect that the schema metadata for that specific post has become corrupted. It seems Rank Math expects a JSON schema array, but is receiving a plain or malformed string instead.

    We already tried:
    – Deleting schema data via the Rank Math Tools
    – Flushing transients and caches
    – Rebuilding analytics index

    The issue persists.

    Can you please advise:
    1. How to safely clean/reset schema metadata for a specific post?
    2. How to prevent this type of corruption?
    3. Whether this is a known issue in the current version?

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    We apologize for the issue you are facing with the fatal error in Rank Math on your specific product. Thank you for providing detailed information about the error and the steps you’ve already taken.

    To address your concerns:

    1. How to Safely Clean/Reset Schema Metadata for a Specific Post

    You can manually delete the schema metadata from your database. Here’s how:

    • Navigate to WordPress DashboardPosts or Pages.
    • Hover over the affected post (in your case, post ID 5338) and note the post ID.
    • Log into your database (usually via cPanel → phpMyAdmin).
    • Select your database and find the postmeta table.
    • Use the search function to filter rows by entering your post ID followed by rank_math_schema.
    • Delete any corrupted schema entries you find.

    After deleting the corrupted schema, return to WordPress and add a new schema to the post using the Rank Math metabox.

    2. How to Prevent This Type of Corruption

    To prevent schema corruption in the future:

    • Ensure all plugins and themes are updated regularly to their latest versions.
    • Avoid abrupt changes or deletions of schema-related data without proper backups.
    • Regularly back up your database to restore it if issues arise.

    3. Is This a Known Issue in the Current Version?

    While we are aware of various issues that can arise with schema, this specific error may not be widely reported. However, it’s always good practice to keep an eye on our support documentation and community forums for updates on known issues and fixes.

    If the problem persists after trying these steps, please reply to this ticket with any additional details or errors you encounter, and a human agent from our support team will assist you further.

    Thank you for your understanding, and we hope this helps resolve your issue!

    Sources:
    Resolving Rank Math Schema Markup Related Issues

    Hello,

    It seems like you’ve marked this ticket as resolved.

    Can you please confirm if you still need our assistance with this topic or anything else?

    Looking forward to hearing back from you.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this ticket.