Title: Undefined array key &#8220;width&#8221; / &#8220;height&#8221;
Last modified: July 22, 2026

---

# Undefined array key “width” / “height”

 *  Resolved [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [2 weeks, 4 days ago](https://wordpress.org/support/topic/undefined-array-key-width-height/)
 * My PHP logs are getting spammed with this warning:
 * [22-Jul-2026 19:53:37 UTC] PHP Warning: Undefined array key “width” in /var/www/
   web/app/plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.php on 
   line 479
   [22-Jul-2026 19:53:37 UTC] PHP Warning: Undefined array key “height”
   in /var/www/web/app/plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.
   php on line 480
 * I understand the issue to be that an SVG is being used as the site logo in the
   Rank Math settings as mentioned here: [https://wordpress.org/support/topic/warning-undefined-array-key-width/](https://wordpress.org/support/topic/warning-undefined-array-key-width/)
 * Since SVGs can be displayed at any dimensions, can Rank Math just omit the dimensions
   or set an arbitrary value for them?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-array-key-width-height%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [2 weeks, 1 day ago](https://wordpress.org/support/topic/undefined-array-key-width-height/#post-18974899)
 * Hello [@jamieburchell](https://wordpress.org/support/users/jamieburchell/),
 * Thank you for contacting Rank Math support.
 * SVG files don’t have a set width and height, and our plugin needs those values
   to include them in the Schema. Please use a supported format like JPG or PNG 
   as the logo in the Local SEO settings to get rid of the warnings.
 * Please do not hesitate to let us know if you need our assistance with anything
   else.
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [2 weeks ago](https://wordpress.org/support/topic/undefined-array-key-width-height/#post-18975259)
 * [@jaideeprm](https://wordpress.org/support/users/jaideeprm/) The width and height
   attributes are optional for the ImageObject in the schema markup, so why not 
   omit them if they are not available instead of not supporting the best format
   for logos? Especially given RankMath does not prevent the use of an SVG or warn
   that the logs will be spammed each time a page request is made.
    -  This reply was modified 2 weeks ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
 *  Plugin Support [Jeremy](https://wordpress.org/support/users/jeremrm/)
 * (@jeremrm)
 * [2 weeks ago](https://wordpress.org/support/topic/undefined-array-key-width-height/#post-18975339)
 * Hello [@jamieburchell](https://wordpress.org/support/users/jamieburchell/),
 * Thank you for the follow-up, and we appreciate you pointing that out.
 * At the moment, our plugin is built around more standard image formats, so we 
   have not yet added specific handling for SVG sizing. That said, this is valid
   feedback and something we will consider for a future improvement.
 * In the meantime, you can use the following filter to remove the `width` and `
   height` properties and stop the warnings from appearing:
 *     ```wp-block-code
       add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {if ( ! isset( $data['publisher'] ) || ! isset( $data['publisher']['image'] ) ) {return $data;}unset($data['publisher']['image']['width']);unset($data['publisher']['image']['height']);return $data;}, 999, 2);
       ```
   
 * You can add this code using a plugin like Code Snippets, or in your theme’s functions.
   php file. For more details on adding filters, please refer to this guide: [https://rankmath.com/kb/wordpress-hooks-actions-filters/](https://rankmath.com/kb/wordpress-hooks-actions-filters/)
 * Please do not hesitate to let us know if you need our assistance with anything
   else.
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [1 week, 6 days ago](https://wordpress.org/support/topic/undefined-array-key-width-height/#post-18975642)
 * Thank you.
 *  Plugin Support [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * (@jaideeprm)
 * [1 week, 6 days ago](https://wordpress.org/support/topic/undefined-array-key-width-height/#post-18976003)
 * Hello [@jamieburchell](https://wordpress.org/support/users/jamieburchell/),
 * We are glad that we were able to address your concerns.
 * Please do not hesitate to let us know if you need our assistance with anything
   else.
 * Thank you.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-array-key-width-height%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](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/)

 * 5 replies
 * 3 participants
 * Last reply from: [Jaideep Asrani](https://wordpress.org/support/users/jaideeprm/)
 * Last activity: [1 week, 6 days ago](https://wordpress.org/support/topic/undefined-array-key-width-height/#post-18976003)
 * Status: resolved