A friend of mine just noticed that their site wasn’t displaying pages that had a lot of content. For some reason they are just blank, and if he removes some content from the page it will display again. The 10,000 character mark seems to be the threshold – anything above and it goes blank.
I played with his templates and noticed that the content would be displayed if I used echo get_the_content()
rather than the_content()
, but then he loses the auto-formatting.
Has anyone run into this issue before? I’ve googled around and searched this site but haven’t been able to find anything. Thanks in advance for any light you can shed on this!
I ran into this problem a year or so ago, and found a fix here.
pcre.recursion_limit=20000000
pcre.backtrack_limit=10000000
As a warning note, if you push this too far and your server is underpowered, you may end up crashing PHP as it consumes the entire stack. Your host may not be too happy about that.
If you don’t have access to your php.ini, you can set these variables inside wp-config.php. Somewhere before the
require_once(ABSPATH . 'wp-settings.php');
, maybe in the debug area (up to you), add these two lines:@ini_set('pcre.backtrack_limit', 10000000);
@ini_set('pcre.recursion_limit', 20000000);