I have a shortcode that just retrieves some info from the options table in the database.

For whatever reason, when the content reaches a certain character limit the_content() to return blank?

The function is pretty basic and I can't for the life me figure out why this is happening?

Here's an example of the code:

function my_custom_shortcode() { return get_option('my_custom_shortcode'); }
add_shortcode('MYSHORTCODE', 'my_custom_shortcode');

Has anyone experienced this before? Thanks!

  • What is the character limit? That column should be a LONGTEXT data type (codex.wordpress.org/Database_Description#Table:_wp_options), so the size shouldn't be a problem. – GavinR Nov 8 '11 at 5:11
  • Cole, please go back an work (comment/accept/edit question/answer) on your old questions. You're already at a point, where high rep users will step back from answering further questions. – kaiser Sep 29 '12 at 13:40

Fixed my problem! I was finally able to find some info out there in the vast internet. Visit this site for info on fixing this odd issue.

Over all using the remove_filter('the_content','wpautop'); did the trick.



In some occasions the_content() will also return blank if a single post/page is viewed and the loop is not initiated. Meaning that you will have to use the code below to be able to see output from the_content.

if ( have_posts() ) : while ( have_posts() ) : the_post();
endwhile; endif;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.