Skip to content

Avoid processing the_content when o2_process_the_content is false#244

Open
dd32 wants to merge 1 commit intomasterfrom
skip-the_content-filter
Open

Avoid processing the_content when o2_process_the_content is false#244
dd32 wants to merge 1 commit intomasterfrom
skip-the_content-filter

Conversation

@dd32
Copy link
Member

@dd32 dd32 commented Feb 3, 2026

This method isn't using the o2_process_the_content filter which can cause a significant speed issue when the content filters are being run in a context that doesn't require the metadata - such as within a shortcode output in the middle of the page.

On URLs such as this:
https://make.wordpress.org/docs/handbook/documentation-team-handbook/tone-and-voice-guide/
Where all of the notice blocks are shortcodes that render the_content within you'd end up with many duplicate o2 <script>'s which then caused shortcode parsing to timeout.

With this change, the page load time of the above page goes from 100+ seconds to <1s when xDebug is enabled, and from 0.6-0.7s to ~0.4 in production.

This method isn't using the `o2_process_the_content` filter which can cause a significant speed issue when the content filters are being run in a context that doesn't require the metadata - such as within a shortcode output in the middle of the page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant