PHP Fatal Errors with Schema Enabled with Theme

  • We just installed and activated the Rank Math plugin for the first time today and ran into PHP Fatal Errors with the Schema features enabled.

    With the Rank Math plugin Schema Enabled with our primary theme I am unable to edit pages in wp admin, though the pages still load correctly for viewing.
    “There has been a critical error on your website. Please check your site admin email inbox for instructions.”

    I am able to QuickEdit without issue. Please let me know if there’s additional information I can provide.
    Our plugins, theme files, and wordpress are all on the latest versions.

    If I activate the Twenty Twenty theme editing pages becomes possible and the errors do not persist.
    If I disable Schema in the Rank Math plugin editing pages becomes possible and the errors do not persist with our primary theme active.

    From the WP Debug log (edited):

    PHP Notice:  CMB2_Field::__construct() was called with a parameter that is <strong>deprecated</strong> since version 2.2.3! Using the "default" field parameter as a callback has been deprecated in favor of the "default_cb" parameter. in .../seo-by-rank-math/vendor/cmb2/cmb2/includes/CMB2_Base.php on line 456
    PHP Warning:  strpos() expects parameter 1 to be string, object given in .../wp-includes/shortcodes.php on line 199
    PHP Warning:  preg_match_all() expects parameter 2 to be string, object given in .../wp-includes/shortcodes.php on line 208
    PHP Warning:  array_intersect(): Argument #2 is not an array in ../themes/global/shortcodes.php on line 209
    PHP Recoverable fatal error:  Object of class CMB2_Field could not be converted to string in .../themes/global/shortcodes.php
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.


    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    It looks like your theme is adding some function without proper prefixing it. As per the WordPress guidelines all the functions in your theme should be prefixed with the theme_name.

    A couple of users had also reported this issue in the past. Prefixing the theme functions had fixed the issue for them. Can you also check and prefix all the functions in your theme?

    I hope that helps.

    Just so I understand, you’re referring to this when you mention proper prefixing in the theme?


    Yes that should do it. I’d recommend to have your theme developer help you in fixing this.

    Looking forward to helping you. Thank you

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

You must be logged in to reply to this ticket.