Title: do_shortcode returns null content
Last modified: August 20, 2016

---

# do_shortcode returns null content

 *  [Rebecca O'Brien](https://wordpress.org/support/users/rjmastey/)
 * (@rjmastey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-returns-null-content/)
 * On one of the sites I manage, I have a custom shortcode for displaying content
   that (long story short) had to be manually placed/rearranged before. The shortcode
   works on other sites using it, but on this one it fails when I play it at the
   very top of the page content.
 * The way the sites are set up, a page holds the content for the front page (but
   it’s separate from the page set as the front page). The shortcode is placed in
   the content page. I retrieve that page using `get_page()`, then run $page->post_content
   through `wpautop()` and then run `do_shortcode()` on the autop’d content. (Yes,
   I know this process is convoluted, just roll with it.)
 * So, I get content back during `wpautop()`. Everything is fine and dandy. I get
   output from the shortcode function when I `var_dump()` instead of return. But,
   if I let it fully process `do_shortcode()` the content switches from lovely, 
   formatted content to NULL. Unless I move the shortcode to the bottom of the content.
   Then it works just fine.
 * Any ideas on why it would clobber all the content? There’s nothing wrong with
   the code – it’s working on many other sites – so it has to be some unaccounted
   difference in the content, but I have no clue where to start looking.

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

 *  [Peter Baylies](https://wordpress.org/support/users/pbaylies/)
 * (@pbaylies)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-returns-null-content/#post-2438713)
 * So you’ve tested this on the latest WordPress 3.3 / trunk? I ask because I do
   see [a bug](http://core.trac.wordpress.org/ticket/8553) that could be related.
   Is `do_shortcode()` processing a lot of content?
 *  Thread Starter [Rebecca O'Brien](https://wordpress.org/support/users/rjmastey/)
 * (@rjmastey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-returns-null-content/#post-2438720)
 * Sorry, I selected the wrong version. I’m actually on 3.2.1.
 *  [Peter Baylies](https://wordpress.org/support/users/pbaylies/)
 * (@pbaylies)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-returns-null-content/#post-2438729)
 * See if you can reproduce the same bug in trunk on a test site; if you can’t, 
   then maybe you’re being affected by a bug that got fixed in 3.3.
 *  Thread Starter [Rebecca O'Brien](https://wordpress.org/support/users/rjmastey/)
 * (@rjmastey)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-returns-null-content/#post-2438753)
 * I’ll give that a shot later today. Thanks for the suggestion!

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

The topic ‘do_shortcode returns null content’ is closed to new replies.

## Tags

 * [do_shortcode](https://wordpress.org/support/topic-tag/do_shortcode/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)
 * [wpautop](https://wordpress.org/support/topic-tag/wpautop/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 4 replies
 * 2 participants
 * Last reply from: [Rebecca O'Brien](https://wordpress.org/support/users/rjmastey/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-returns-null-content/#post-2438753)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
