Undefined array key “type” in class-local-seo.php on line 333

#1107521
  • Steve Parry
    Rank Math free

    I am new to Rank Math SEO, testing it as part of the Divi5 theme Alpha program. I’m using Version 1.0.253.

    I’m investigating why I have an apparent 1/100 score. The setup appears correct but I did notice a PHP warning being raised when I load my page :

    PHP Warning: Undefined array key “type” in /home/xxxxx/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/local-seo/class-local-seo.php on line 333

    A bit of logging shows that an array ($property) is being passed without ‘type’ being set, although ‘value’ is present.
    The debug line is:
    error_log (‘$property= ‘ . $property[‘type’] . ‘:’ . $property[‘value’] . PHP_EOL);
    The result is:
    [23-Sep-2025 01:30:37 UTC] $property= :Environ Painting and Decorating

    Any advice appreciated!

Viewing 1 replies (of 1 total)
  • Hello,

    We apologize for the issue you are facing with the PHP warning regarding the undefined array key "type" in the Rank Math plugin. This warning typically indicates that there is a missing key in the array being processed, which can happen due to various reasons, including conflicts with themes or other plugins.

    To address this issue, we recommend the following steps:

    1. Update Plugins and Themes: Ensure that you are using the latest version of Rank Math and your Divi5 theme. Sometimes, updates can resolve compatibility issues.

    2. Check for Plugin Conflicts: Deactivate all other plugins except for Rank Math and see if the warning persists. If it resolves, reactivate each plugin one by one to identify which one is causing the conflict.

    3. Review Local SEO Settings: Since the warning is coming from the Local SEO module, double-check your settings in that section to ensure everything is configured correctly.

    4. Debugging: If you are comfortable with PHP, you can add a check before accessing the ‘type’ key in the code to prevent the warning:

      if (isset($property['type'])) {
         error_log('$property= ' . $property['type'] . ':' . $property['value'] . PHP_EOL);
      } else {
         error_log('$property= : ' . $property['value'] . PHP_EOL);
      }

      This will help you log the output without causing a warning.

    5. Contact Support: If the issue persists after trying these steps, please reply to this ticket with your site URL and any additional details. A human agent from our support team will be able to assist you further.

    Thank you for bringing this to our attention, and we hope this helps resolve your issue!

    This is an automated reply from Rank Math Support Bot. Your ticket has been assigned to a human agent and we will get back to you shortly.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.