Bug description
On Divi 5 sites with Theme Builder and hierarchical pages, activating AIOSEO Pro causes front-end layout corruption on child pages: et_pb_section_* classes receive CSS rules intended for other sections (e.g. hero backgrounds applied to body sections). The Divi Visual Builder preview is unaffected. Deactivating AIOSEO Pro restores correct rendering on the next request.
Environment
| Component |
Version |
| WordPress |
7.x |
| Divi |
5.8+ |
| AIOSEO Pro |
4.9.9 |
| PHP |
8.1+ |
| Theme Builder |
Yes (header/body/footer templates) |
| Page structure |
Hierarchical (post_parent chain, 2+ levels) |
Minimal reproduction
- Create a 3-level page hierarchy built with Divi 5, e.g.
/services/ → /services/patients/ → /services/patients/billing/.
- Leave ancestor pages without a
post_excerpt.
- Under Search Appearance → Content Types → Pages, set Meta Description to
#post_excerpt (default-adjacent configuration).
- Leave schema markup enabled (default).
- Load the deepest child page on the front end.
Expected: Front-end output matches Visual Builder.
Actual: Section index CSS is wrong; disabling AIOSEO Pro fixes it immediately.
Observed symptom
Per-page dynamic CSS targets the wrong section index, e.g. et_pb_section_7 receives background rules that belong to a hero section defined elsewhere in the layout.
Call path (confirmed)
During wp_head, schema output triggers breadcrumb context assembly before the main query renders page body content:
AIOSEO\Plugin\Common\Main\Head::wpHead() → schema.php
Schema::get() → determineSmartGraphsAndContext() → Context::post()
Breadcrumb::post() → postHierarchical() — iterates every ancestor
- For each ancestor:
Description::getDescription( $post ) → getPostDescription()
Helpers::sanitize() → Tags::replaceTags() with template #post_excerpt
Tags::getTagValue( 'post_excerpt' ) — when post_excerpt is empty, falls through to post_content case
WpContext::getDescriptionFromContent() → getPostContent()
PageBuilders\Divi::processContent() → renderDivi5ContentForExtraction()
apply_filters( 'the_content', $content ) — runs before main loop / child page render
Relevant source locations:
app/Common/Schema/Breadcrumb.php — postHierarchical(), ~L56–76
app/Common/Schema/Context.php — post(), ~L103–109
app/Common/Utils/Tags.php — post_excerpt / post_content switch fallthrough, ~L1151–1162
app/Common/Traits/Helpers/WpContext.php — getPostContent(), ~L348–372
app/Common/Standalone/PageBuilders/Divi.php — renderDivi5ContentForExtraction(), ~L245–257
Root cause
postHierarchical() resolves a full meta description for each ancestor post while building JSON-LD breadcrumb context during wp_head. For Divi-built ancestors without excerpts, description resolution invokes Divi 5 full content rendering (the_content), which increments ET_Builder_Module_Order and generates static CSS keyed by section index.
The main queried object (the child page) then renders with a corrupted module order index, so et_pb_section_N in HTML no longer aligns with the CSS generated for that request.
Regression / partial mitigation note
4.9.9 added ET_Builder_Module_Order::reset_all_indexes() in a finally block after renderDivi5ContentForExtraction() (see comment at Divi.php ~L237–238). This does not appear sufficient when:
- Multiple ancestors are processed in one
wp_head pass, and/or
- Theme Builder layout types are active on the same request
The issue persists on 4.9.9 with the reset in place.
Ruled out (for triage)
These do not reproduce or resolve the issue in isolation:
- Changing only the child page excerpt (ancestors still processed in breadcrumb walk)
- Replacing
#post_content with #post_excerpt in page meta template (empty excerpt still falls through to content extraction)
- Disabling LLMs.txt, Image SEO, TruSEO, or reinstalling the plugin (options persist; trigger is
wp_head schema)
aioseo_page_builder_integration_disable for divi — only skips VB panel init() in PageBuilders\Base::_init() (~L73); does not gate processContent() used by getPostContent()
Suggested fix
When resolving descriptions for breadcrumb/schema context (especially for posts that are not the main queried object):
- Do not call
getDescriptionFromContent() / getPostContent() / processContent() for Divi 5 content, or
- Use a safe text source only (
post_title, non-empty post_excerpt, static template) with no fallthrough to full content rendering, or
- Defer breadcrumb description resolution to data that does not invoke
the_content on builder content
If content extraction must remain for other features, scope it so renderDivi5ContentForExtraction() never runs during wp_head on front-end singular views, or fully resets Divi 5 static CSS state (including Theme Builder layout scopes) after each extraction pass.
Severity
High for Divi 5 + hierarchical sites: silent visual regression on production, VB shows correct layout, fix requires plugin deactivation or custom workaround. Affects any child page whose ancestors lack excerpts under the default #post_excerpt meta template.
Bug description
On Divi 5 sites with Theme Builder and hierarchical pages, activating AIOSEO Pro causes front-end layout corruption on child pages:
et_pb_section_*classes receive CSS rules intended for other sections (e.g. hero backgrounds applied to body sections). The Divi Visual Builder preview is unaffected. Deactivating AIOSEO Pro restores correct rendering on the next request.Environment
post_parentchain, 2+ levels)Minimal reproduction
/services/→/services/patients/→/services/patients/billing/.post_excerpt.#post_excerpt(default-adjacent configuration).Expected: Front-end output matches Visual Builder.
Actual: Section index CSS is wrong; disabling AIOSEO Pro fixes it immediately.
Observed symptom
Per-page dynamic CSS targets the wrong section index, e.g.
et_pb_section_7receives background rules that belong to a hero section defined elsewhere in the layout.Call path (confirmed)
During
wp_head, schema output triggers breadcrumb context assembly before the main query renders page body content:AIOSEO\Plugin\Common\Main\Head::wpHead()→schema.phpSchema::get()→determineSmartGraphsAndContext()→Context::post()Breadcrumb::post()→postHierarchical()— iterates every ancestorDescription::getDescription( $post )→getPostDescription()Helpers::sanitize()→Tags::replaceTags()with template#post_excerptTags::getTagValue( 'post_excerpt' )— whenpost_excerptis empty, falls through topost_contentcaseWpContext::getDescriptionFromContent()→getPostContent()PageBuilders\Divi::processContent()→renderDivi5ContentForExtraction()apply_filters( 'the_content', $content )— runs before main loop / child page renderRelevant source locations:
app/Common/Schema/Breadcrumb.php—postHierarchical(), ~L56–76app/Common/Schema/Context.php—post(), ~L103–109app/Common/Utils/Tags.php—post_excerpt/post_contentswitch fallthrough, ~L1151–1162app/Common/Traits/Helpers/WpContext.php—getPostContent(), ~L348–372app/Common/Standalone/PageBuilders/Divi.php—renderDivi5ContentForExtraction(), ~L245–257Root cause
postHierarchical()resolves a full meta description for each ancestor post while building JSON-LD breadcrumb context duringwp_head. For Divi-built ancestors without excerpts, description resolution invokes Divi 5 full content rendering (the_content), which incrementsET_Builder_Module_Orderand generates static CSS keyed by section index.The main queried object (the child page) then renders with a corrupted module order index, so
et_pb_section_Nin HTML no longer aligns with the CSS generated for that request.Regression / partial mitigation note
4.9.9 added
ET_Builder_Module_Order::reset_all_indexes()in afinallyblock afterrenderDivi5ContentForExtraction()(see comment atDivi.php~L237–238). This does not appear sufficient when:wp_headpass, and/orThe issue persists on 4.9.9 with the reset in place.
Ruled out (for triage)
These do not reproduce or resolve the issue in isolation:
#post_contentwith#post_excerptin page meta template (empty excerpt still falls through to content extraction)wp_headschema)aioseo_page_builder_integration_disablefordivi— only skips VB panelinit()inPageBuilders\Base::_init()(~L73); does not gateprocessContent()used bygetPostContent()Suggested fix
When resolving descriptions for breadcrumb/schema context (especially for posts that are not the main queried object):
getDescriptionFromContent()/getPostContent()/processContent()for Divi 5 content, orpost_title, non-emptypost_excerpt, static template) with no fallthrough to full content rendering, orthe_contenton builder contentIf content extraction must remain for other features, scope it so
renderDivi5ContentForExtraction()never runs duringwp_headon front-end singular views, or fully resets Divi 5 static CSS state (including Theme Builder layout scopes) after each extraction pass.Severity
High for Divi 5 + hierarchical sites: silent visual regression on production, VB shows correct layout, fix requires plugin deactivation or custom workaround. Affects any child page whose ancestors lack excerpts under the default
#post_excerptmeta template.