GenerateBlocks Timing Out

  • My site keeps timing out, and after doing a trace on it it’s saying that the source of the problem is this code:

    if ( ! in_array( get_post_type(), $nonpublic_post_types ) && ! is_admin() ) {
    return sprintf(
    '<div class="dynamic-entry-content">%s</div>',
    apply_filters( 'the_content', str_replace( ']]>', ']]>', get_the_content() ) ) // phpc$
    );
    }
    }

    Do you know what aspect of your plugin this is related to? I’m trying to narrow down the source of the problem. Thanks for any help.

    – Aaron

  • I’ve disabled Advanced Ads and Advanced Ads Pro and the site hasn’t timed out later. Are you aware of any conflicts with either of these plugins?

  • Hi Aaron,

    That snippet is from GenerateBlocks — it’s part of how we render post content for dynamic tags / Content Templates, where we pass the content back through the_content filters so shortcodes, blocks, and other filters resolve correctly.

    The issue you’re describing sounds like a recursion loop between GenerateBlocks and Advanced Ads. Advanced Ads injects ads by hooking into the_content, and if that injection happens inside a context that’s already being rendered by our dynamic content function, the nested apply_filters( 'the_content', ... ) call can trigger Advanced Ads again, which re-renders the block, and so on until PHP times out.

    A few things that would help us narrow it down:

    1. Are you using a GenerateBlocks Content Template, Loop block, or a dynamic content tag (like Post Content) on the affected page/template?
    2. In Advanced Ads, do you have any placements set to inject into post content automatically?
    3. If you re-enable Advanced Ads but temporarily disable just the content-injection placements, does the timeout return?

    If you can share a URL where this happens (or the template setup), we can dig in further. In the meantime, disabling Advanced Ads is a reasonable workaround while we confirm the conflict.

  • Thanks. Here are some answers to your questions:

    Are you using a GenerateBlocks Content Template, Loop block, or a dynamic content tag (like Post Content) on the affected page/template?

    For single posts that receive content injections, the following Content Template element is used:

    https://maconsensecom.bigscoots-staging.com/wp-admin/post.php?post=531&action=edit

    In Advanced Ads, do you have any placements set to inject into post content automatically?

    Yes, we have enabled them in the “Inside Post Content” placement.

    https://maconsensecom.bigscoots-staging.com/wp-admin/edit.php?post_type=advanced_ads_plcmnt

    If you re-enable Advanced Ads but temporarily disable just the content-injection placements, does the timeout return?

    I’ve temporarily modified the “Inside Post Content” placement so that it only injects the ads for logged-out users while viewing a post in the event post type. In theory, we should be able to trigger it by going to the following link while logged OUT:

    https://maconsensecom.bigscoots-staging.com/event/nantahala-hiking-club-speaker/

    Otherwise, the content injection shouldn’t happen. Previously, I had it enabled for all posts in the post post type, regardless of login status.

    If you can share a URL where this happens (or the template setup), we can dig in further. In the meantime, disabling Advanced Ads is a reasonable workaround while we confirm the conflict.

    No problem. I have included access details in the private information. I will leave Advanced Ads enabled for now so you can go in and take a look at things.

  • Hi Aaron,

    Thanks for the access. I loaded the event URL in a logged-out session and the page rendered fine — I saw the “Your ad here” placeholder but no timeout. Can you confirm whether the issue is still reproducing on your end with the current placement configuration?

    Also, a couple of questions to help narrow this down:

    1. When the timeouts were happening previously on the post post type, was it on every post or only specific ones?
    2. Is the single event template using a GenerateBlocks Content Template or Loop element? If so, could you let me know which element it is so I can check how it’s rendering the post content?

    Thanks!

  • I put my settings back to normal and the site has frozen up once. It happened while editing the homepage in GenerateBlocks, but I’m not sure if that was the actual trigger. Right now I have events using the same content template as posts but will change that shortly — so, in theory, they should exhibit the same behavior.

    The single post template uses a Content Template, not a loop element.

  • I took a look at the ad configuration and the “Inside Post Body” placement is currently serving only the “Your Ad Here” placeholder image, which on its own shouldn’t cause a recursion loop. To move this forward, could you check your PHP error log around the time of the freezes and share anything relevant? You’re looking for fatal errors, “Maximum function nesting level reached”, “Allowed memory size exhausted”, or any stack traces. On the site, the error log is usually accessible via the hosting panel or at wp-content/debug.log if WP_DEBUG_LOG is enabled.

    That’ll tell us whether this is actually a recursion loop and, if so, exactly which functions are calling each other.

  • This is the main error we saw when first experiencing the problem:

    [03-Apr-2026 19:52:32 UTC] PHP Fatal error: Maximum execution time of 120 seconds exceeded in /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/generateblocks/includes/functions.php on line 1844

    And here are more entries that may or may not be related:

    [07-Apr-2026 12:13:03] [pool php83-www] pid 21751
    script_filename = /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/index.php
    [0x00007f5373c15dc0] add_filter() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:1288
    [0x00007f5373c15a20] apply_block_hooks_to_content_from_post_object() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-hook.php:341
    [0x00007f5373c156b0] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/plugin.php:205
    [0x00007f5373c15480] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:325
    [0x00007f5373c15310] do_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:290
    [0x00007f5373c151a0] do_dynamic_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:599
    [0x00007f5373c14300] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:579
    [0x00007f5373c13460] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2383
    [0x00007f5373c13260] render_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2466
    [0x00007f5373c13060] do_blocks() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-hook.php:341
    [0x00007f5373c12cf0] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/plugin.php:205
    [0x00007f5373c12ac0] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:325
    [0x00007f5373c12950] do_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:290
    [0x00007f5373c127e0] do_dynamic_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:599
    [0x00007f5373c11940] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:579
    [0x00007f5373c10aa0] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2383
    [0x00007f5373c108a0] render_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2466
    [0x00007f5373c106a0] do_blocks() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-hook.php:341
    [0x00007f5373c10330] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/plugin.php:205
    [0x00007f5373c10100] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:325

    I’ll see if I can get more the next time the issue happens.

    — Aaron

  • Hi Aaron,

    One more thing that would help confirm the diagnosis: could you deactivate Advanced Ads again and then try to trigger the freeze? Based on the stack trace, the recursion loop is entirely within GP Premium and WordPress core — Advanced Ads doesn’t appear in the call chain at all. That suggests disabling it earlier may have just changed the timing enough to mask the issue rather than actually fixing it.

    If you can still reproduce the freeze with Advanced Ads deactivated, that confirms it’s purely a GP Premium issue and we can rule Advanced Ads out entirely. If it stops happening, then Advanced Ads is somehow contributing even though it’s not in the trace, and that’s worth knowing too.

  • Okay, I will try that and report back. In the meantime, it could be coincidental, but I seem to experience the issue when making changes to the homepage.

  • I was able to trigger it after Advanced Ads and Advanced Ads Pro were both disabled. I opened the homepage, clicked save, and it started spinning its wheels again.

    https://maconsensecom.bigscoots-staging.com/wp-admin/post.php?post=119&action=edit

    I’ll try again later to see if I can reproduce it again, just in case some process from before was still stuck.

  • I’m going to leave those two plugins disabled for a bit if you want to go test yourself. Thanks again for the help.

  • Sorry for multiple messages. I just got a trace from the host on one of the last crashes. I’m pasting it here:

    “””

    Here is the recent trace

    script_filename = /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/index.php
    [0x00007f2e026db160] generateblocks_get_block_defaults() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/generateblocks/includes/blocks/class-container.php:956
    [0x00007f2e026daaa0] render_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:599
    [0x00007f2e026d9c00] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:579
    [0x00007f2e026d8d60] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2383
    [0x00007f2e026d8b60] render_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2466
    [0x00007f2e026d8960] do_blocks() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-hook.php:341
    [0x00007f2e026d85f0] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/plugin.php:205
    [0x00007f2e026d83c0] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:325
    [0x00007f2e026d8250] do_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:290
    [0x00007f2e026d80e0] do_dynamic_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:599
    [0x00007f2e026d7240] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:579
    [0x00007f2e026d63a0] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2383
    [0x00007f2e026d61a0] render_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2466
    [0x00007f2e026d5fa0] do_blocks() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-hook.php:341
    [0x00007f2e026d5c30] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/plugin.php:205
    [0x00007f2e026d5a00] apply_filters() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:325
    [0x00007f2e026d5890] do_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-content/plugins/gp-premium/elements/class-block-elements.php:290
    [0x00007f2e026d5720] do_dynamic_content_block() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:599
    [0x00007f2e026d4880] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/class-wp-block.php:579
    [0x00007f2e026d39e0] render() /home/nginx/domains/maconsensecom.bigscoots-staging.com/public/wp-includes/blocks.php:2383

    Also I am seeing multiple POST request:

    153.66.163.190 – – [08/Apr/2026:18:52:57 -0500] “POST /wp-json/generateblocks/v1/dynamic-tag-replacements?_locale=user HTTP/2.0” 200 83 “maconsensecom.bigscoots-staging.com/wp-admin/post.php?post=119&action=edit” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36”
    153.66.163.190 – – [08/Apr/2026:18:52:58 -0500] “POST /wp-json/generateblocks/v1/dynamic-tag-replacements?_locale=user HTTP/2.0” 200 203 “maconsensecom.bigscoots-staging.com/wp-admin/post.php?post=119&action=edit” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36”
    153.66.163.190 – – [08/Apr/2026:18:52:58 -0500] “POST /wp-json/generateblocks/v1/dynamic-tag-replacements?_locale=user HTTP/2.0” 200 71 “maconsensecom.bigscoots-staging.com/wp-admin/post.php?post=119&action=edit” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/146.0.0.0 Safari/537.36

  • Hi,

    I tried troubleshooting but the site is very slow. I can also see you still have Advanced Ads and Advanced Ads Pro enabled.

    I notice the “Single – Post” Content Template is scoped to “Post”, but your homepage has several Query Loops pulling in posts. When a Query Loop iterates through posts and sets up each post’s context, it’s possible the Content Template’s display rule is matching during those child render passes, which would explain the recursion on the homepage specifically.

    Two things that would help confirm this:

    1. Could you look at the post currently marked as sticky (the “Featured Post” query loop on the homepage pulls a single sticky post)? If you can share its block content — or even just let me know if it contains any GB blocks with dynamic content, Content Templates, or anything unusual — that would help.
    2. As a test, could you temporarily unstick the current sticky post and see if the homepage save still freezes? If it stops freezing, we’ve likely found the trigger.
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.