Title: PHP Warning: Empty string supplied as input
Last modified: November 19, 2019

---

# PHP Warning: Empty string supplied as input

 *  [alx359](https://wordpress.org/support/users/alx359/)
 * (@alx359)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-warning-empty-string-supplied-as-input/)
 * I’m sporadically getting the following entry in debug.log:
 * `PHP Warning: DOMDocument::loadHTML(): Empty string supplied as input in /plugins/
   wp-seopress/inc/functions/sitemap/template-xml-sitemaps-single.php on line 137`

Viewing 1 replies (of 1 total)

 *  Plugin Author [Benjamin Denis](https://wordpress.org/support/users/rainbowgeek/)
 * (@rainbowgeek)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/php-warning-empty-string-supplied-as-input/#post-12153996)
 * Hi,
 * thank you for your feedback.
 * Can you try to add this code in the file (/plugins/wp-seopress/inc/functions/
   sitemap/template-xml-sitemaps-single.php):
 * at line 137, replace with this:
 *     ```
       							if ($post_content !="") {
       								if (function_exists('mb_convert_encoding')) {
       									$dom->loadHTML(mb_convert_encoding($post_content, 'HTML-ENTITIES', 'UTF-8'));
       								} else {
       									$dom->loadHTML('<?xml encoding="utf-8" ?>'.$post_content);
       								}
   
       								$dom->preserveWhiteSpace = false;
   
       								if ($dom->getElementsByTagName('img') !='') {
       									$images = $dom->getElementsByTagName('img');
       								}
       							}
       ```
   
 * Save the file and let me know if you still see the warning.
 * Hope it helps!

Viewing 1 replies (of 1 total)

The topic ‘PHP Warning: Empty string supplied as input’ is closed to new replies.

 * ![](https://ps.w.org/wp-seopress/assets/icon-128x128.gif?rev=3158903)
 * [SEOPress - AI SEO Plugin & On-site SEO](https://wordpress.org/plugins/wp-seopress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-seopress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-seopress/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-seopress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-seopress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-seopress/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Benjamin Denis](https://wordpress.org/support/users/rainbowgeek/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/php-warning-empty-string-supplied-as-input/#post-12153996)
 * Status: not resolved