Title: $content is an empty string?
Last modified: August 21, 2016

---

# $content is an empty string?

 *  [Mentalhead](https://wordpress.org/support/users/mentalhead/)
 * (@mentalhead)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/content-is-an-empty-string/)
 * I’m making a plugin to parse my post content with PHP, and I have this line of
   code:
 *     ```
       <?php
       function mb_find_my_image( $content ) {
           if( is_home() ) { /* if is home start */
   
             $dom = new domDocument;
             $dom->loadHTML($content);
             $dom->preserveWhiteSpace = false;
   
           } /* if is home end */
           return $content;
       }
       add_filter( 'the_content', 'mb_find_my_image' );
       ?>
       ```
   
 * However, I’m always getting a “Empty string supplied as input” error.
    I’m guessing
   that $content variable is the problem, but I don’t know what’s wrong.
 * I’m testing this using WAMP on my local computer.
 * _[[bump moderated](http://codex.wordpress.org/Forum_Welcome#No_Bumping)]_

The topic ‘$content is an empty string?’ is closed to new replies.

## Tags

 * [content](https://wordpress.org/support/topic-tag/content/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [Mentalhead](https://wordpress.org/support/users/mentalhead/)
 * Last activity: [12 years, 12 months ago](https://wordpress.org/support/topic/content-is-an-empty-string/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
