Title: PHP Warning: Undefined array key &#8220;html&#8221; in EmbedPressBlockRenderer.php 1672
Last modified: September 18, 2026

---

# PHP Warning: Undefined array key “html” in EmbedPressBlockRenderer.php 1672

 *  [metalinedev](https://wordpress.org/support/users/metalinedev/)
 * (@metalinedev)
 * [1 week, 5 days ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-html-in-embedpressblockrenderer-php-1672/)
 * Hi,
 * I’m getting a recurring PHP warning from EmbedPress on a production site.
 * Environment
    - EmbedPress 4.6.6 (free version, no Pro)
    - WordPress 7.1.1
    - PHP 8.3.31
    - Rank Math SEO (generates the XML sitemaps)
 * The warning
   PHP Warning: Undefined array key “html” in/wp-content/plugins/embedpress/
   EmbedPress/Gutenberg/EmbedPressBlockRenderer.php on line 1672
 * It fires about 90 times a day (373 times over the last four days). Around 97%
   of the
   occurrences happen while Rank Math renders the XML sitemaps (/post-sitemap5.
   xml andsimilar, requested by search engine crawlers), the rest on single blog
   posts thatcontain Facebook and Instagram embeds.
 * The cause
   In render_displayable_content() (line 1656), $embed can be either a
   string or an array,and the array is not guaranteed to contain an ‘html’ key:
 *     ```wp-block-code
       if (is_array($embed)) {
           echo $embed['html'];   // line 1672
       } else {
           echo $embed;
       }
       ```
   
 * Two more spots in the same function make the same assumption:
    - Line 1661: $embed[‘html’] .= $styling[‘custom_branding’][‘html’];
      Same undefined
      key warning when custom branding is enabled.
    - Line 1668: $embed .= Helper::embed_content_share($content_id, $attributes);
      
      This concatenates a string onto $embed without checking whether it is an array.
      OnPHP 8 that is a fatal TypeError (“Unsupported operand types: array . string”),
      not awarning. I have not hit it, presumably because content share is disabled
      here, but itlooks like a crash waiting to happen for anyone who enables that
      option on a providerthat returns an array.
 * Suggested fix
   Normalising $embed to a string once, at the top of the function,
   would fix all three:
 *     ```wp-block-code
       private static function render_displayable_content($embed, $content_share, $content_id, $attributes, $styling = [])
       {
           $html = is_array($embed) ? ($embed['html'] ?? '') : (string) $embed;
   
           if (!empty($styling['custom_branding']['html'])) {
               $html .= $styling['custom_branding']['html'];
           }
   
           if (!empty($content_share)) {
               $html .= Helper::embed_content_share($content_id, $attributes);
           }
   
           echo $html;
       }
       ```
   
 * One question: is it expected for a provider to return an array without an ‘html’
   key, or
   does that point to an upstream problem in how the embed is fetched? If
   the array ismalformed, silencing the warning would only hide the real issue.
 * I’m happy to test a patch on this site if that helps.
 * Thanks!

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

 *  Plugin Support [Amin](https://wordpress.org/support/users/amin7/)
 * (@amin7)
 * [1 week, 5 days ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-html-in-embedpressblockrenderer-php-1672/#post-19023705)
 * Hi [@metalinedev](https://wordpress.org/support/users/metalinedev/) 
   Greetings!
   Sorry for your experience. But, I could not replicate the issue on my side, but,
   I already informed the team, and we don’t want to simply suppress the warning
   and potentially hide the underlying issue. The dev team will investigate what`
   $embed` contains at the point where the warning occurs, particularly during the
   sitemap rendering process.
 * Could you please provide the relevant `debug.log` entry with the `$embed` value
   logged when the warning occurs? That should help us determine whether the data
   is coming from an upstream provider response or from EmbedPress’s internal processing.
   
   Regarding the other quesry, I am sorry, I can’t confirm whether an array without
   an `html` key is an expected provider response or indicates incomplete data from
   the upstream embed request. So, I forwarded this one as well to the dev team.
   🙂 I will inform you accordingly once I get the update fromm them.Thanks
 *  Plugin Support [Amin](https://wordpress.org/support/users/amin7/)
 * (@amin7)
 * [1 week, 1 day ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-html-in-embedpressblockrenderer-php-1672/#post-19026436)
 * Hi [@metalinedev](https://wordpress.org/support/users/metalinedev/) 
   Greetings!
   I got an update from the dev team. They have fixed the PHP warning issue that
   you are facing earlier. 🙂 Please use the dev version of the free plugin from
   here, [https://d.pr/f/zVxqKh](https://d.pr/f/zVxqKh) and replace your current
   free plugin. Let me know how its going.Thanks
 *  Plugin Support [Ashikur Rahman](https://wordpress.org/support/users/ashikurwp/)
 * (@ashikurwp)
 * [2 days, 23 hours ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-html-in-embedpressblockrenderer-php-1672/#post-19030620)
 * Hi [@metalinedev](https://wordpress.org/support/users/metalinedev/) ,
   Greetings!
   We have not heard back from you since our last message, so I just wanted to follow
   up and check whether the issue is still occurring on your end. If you are still
   experiencing the same problem, please feel free to share any updates or additional
   information. We will be happy to assist you further.
 * Looking forward to your response.
 * Thank you.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-warning-undefined-array-key-html-in-embedpressblockrenderer-php-1672%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/embedpress/assets/icon-128x128.gif?rev=3419899)
 * [EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents](https://wordpress.org/plugins/embedpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/embedpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/embedpress/)
 * [Active Topics](https://wordpress.org/support/plugin/embedpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/embedpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/embedpress/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Ashikur Rahman](https://wordpress.org/support/users/ashikurwp/)
 * Last activity: [2 days, 23 hours ago](https://wordpress.org/support/topic/php-warning-undefined-array-key-html-in-embedpressblockrenderer-php-1672/#post-19030620)
 * Status: not resolved