WordPress ‘Critical Error’ Fix: Rank Math Schema Module Crash on PHP 8.2

A help note for other WordPress site owners. If your whole site shows “There has been a critical error on this website” but your wp-admin dashboard still works, this might be your problem.

Symptoms

  • Every public page returns HTTP 500 — “There has been a critical error on this website.”
  • The WordPress admin dashboard (/wp-admin) still loads and works normally.
  • The site worked fine until a recent WordPress and/or PHP update.

Environment where this happened

  • WordPress 7.0
  • PHP 8.2
  • Rank Math SEO (current version, 1.0.271.x)
  • Astra theme, AWS Lightsail (Bitnami) server

The actual error

Found in the server PHP/Apache error log:

PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in .../plugins/seo-by-rank-math/includes/modules/schema/class-frontend.php:73 -- triggered from array_filter() in add_schema() / JsonLD json_ld()

What is going on

Rank Math’s Schema (Structured Data) / JSON-LD module is the culprit. On PHP 8.2 it throws a fatal TypeError when a stored schema value is a plain string where the code expects an array (corrupted or malformed schema data). Because schema markup is generated on every front-end page, the error takes down the entire public site — but the admin area, which does not build that markup, keeps working.

The fix (lowest SEO impact)

  1. Log in to /wp-admin (it still works).
  2. Go to Rank Math → Dashboard.
  3. Toggle OFF the Schema (Structured Data) module.
  4. Reload your front end — it should come back immediately.

This keeps the rest of Rank Math working (titles, meta descriptions, sitemap, redirects, 404 monitor) and only disables structured-data markup, so the SEO impact is minimal.

If you cannot reach the error log

With no SSH access, you can still read the server error log from the dashboard using a PHP-runner plugin (such as Code Snippets) to print the last lines of the Apache/PHP error log. That is how the exact error above was found.

Restoring schema later

To get structured data back, reset Rank Math’s schema data (Rank Math → Status & Tools → Database Tools), or wait for a Rank Math update that handles the bad value, then re-enable the module.

Hope this saves someone a stressful afternoon.

Scroll to Top