Title: Warning: Undefined array key &#8220;width&#8221;
Last modified: January 14, 2025

---

# Warning: Undefined array key “width”

 *  Resolved [Rob Watson](https://wordpress.org/support/users/rcwatson/)
 * (@rcwatson)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/)
 * This plugin is producing this warning message on sites in debug mode
   Warning:
   Undefined array key “width” in /code/wp-content/plugins/seo-by-rank-math/includes/
   modules/schema/class-jsonld.php on line 475 Warning: Undefined array key “height”
   in /code/wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.
   php on line 476
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwarning-undefined-array-key-width%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18244912)
 * Hello [@rcwatson](https://wordpress.org/support/users/rcwatson/),
    Thank you 
   for contacting Rank Math support, and sorry for any inconvenience that might 
   have been caused due to that. The issue you mention is most likely related to
   the Image SEO module and it happens when you have set some image replacements
   incorrectly or empty under WordPress Dashboard > Rank Math > General Settings
   > Images: [https://rankmath.com/kb/image-seo/#replacements](https://rankmath.com/kb/image-seo/#replacements)
   We recommend checking those and making sure that there’s no empty replacement
   value in the settings. Hope that helps.
 *  Thread Starter [Rob Watson](https://wordpress.org/support/users/rcwatson/)
 * (@rcwatson)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18245517)
 * I didn’t see any settings with empty or incorrectly set image replacements. I
   even reset all settings on a test server and the warning still appears.
 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18246804)
 * Hello [@rcwatson](https://wordpress.org/support/users/rcwatson/),
   We apologize
   for the previous reply as it’s not accurate.The issue is due to the fact that
   you are using an SVG image for the logo of the website under WordPress Dashboard
   > Rank Math SEO > Titles & Meta > Local SEO. Given that SVG images don’t have
   the metadata necessary to extract the width and height, those messages appear
   on the website.
 * You can either ignore the messages or change the image to a format that contains
   data about the width and height such as JPEG or PNG.
   Don’t hesitate to get in
   touch if you have any other questions.
 *  Thread Starter [Rob Watson](https://wordpress.org/support/users/rcwatson/)
 * (@rcwatson)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18247848)
 * Thank you. I’ve passed this along to the developers.
 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18253223)
 * Hello [@rcwatson](https://wordpress.org/support/users/rcwatson/),
    Sounds good!
   If you have any other questions don’t hesitate to get in touch. We are here to
   help!
 *  [lopezacceseo](https://wordpress.org/support/users/lopezacceseo/)
 * (@lopezacceseo)
 * [11 months ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18547626)
 * Hi all.
 * I’m searching about this “warning” too. It seems that the image should be png/
   jpg and not svg, because the function wp_get_attachment_metadata seems that can’t
   handle the width/height of svgs files. Reviewing the plugin, if i change the 
   lines on the file:
 * $entity[‘logo’][‘width’] = $attachment[‘width’];
 * $entity[‘logo’][‘height’] = $attachment[‘height’];
 * With this
 * $entity[‘logo’][‘width’] = (!empty($attachment[‘width’])) ? $attachment[‘width’]:
   0;
 * $entity[‘logo’][‘height’] = (!empty($attachment[‘height’])) ? $attachment[‘height’]:
   0;
 * The warning dissapears.
 * Don’t know if setting a 0 width / height by default is good, but the warning 
   is solved.
 * Best regards
 *  Plugin Support [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * (@rankmathsupport)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18555642)
 * Hello [@lopezacceseo](https://wordpress.org/support/users/lopezacceseo/),
 * We appreciate you taking the effort to go through the codebase and share your
   insights. We will pass this along to our developers to gather their feedback 
   on this proposed solution.
 * If they decide to implement something like this we will update the plugin soon
   and credit your solution in our changelog.
 * Thank you.

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

The topic ‘Warning: Undefined array key “width”’ is closed to new replies.

 * ![](https://ps.w.org/seo-by-rank-math/assets/icon.svg?rev=3438330)
 * [Rank Math SEO – AI SEO Tools to Dominate SEO Rankings](https://wordpress.org/plugins/seo-by-rank-math/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/seo-by-rank-math/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/seo-by-rank-math/)
 * [Active Topics](https://wordpress.org/support/plugin/seo-by-rank-math/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/seo-by-rank-math/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/seo-by-rank-math/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [Rank Math Support](https://wordpress.org/support/users/rankmathsupport/)
 * Last activity: [10 months, 3 weeks ago](https://wordpress.org/support/topic/warning-undefined-array-key-width/#post-18555642)
 * Status: resolved