window.addEventListener('load', function () { function cleanAccordion() { const accordions = document.querySelectorAll('.acf-accordion'); accordions.forEach(function (acc) { const items = acc.querySelectorAll('.e-n-accordion-item'); items.forEach(function (item) { const content = item.querySelector('.e-n-accordion-item-content'); if (!content) return; const cleaned = content.textContent.replace(/\u00a0/g, '').trim(); if (!cleaned) { item.remove(); } }); }); } // Run once cleanAccordion(); // Run again after Elementor loads interactions (THIS is the key) setTimeout(cleanAccordion, 500); setTimeout(cleanAccordion, 1000); });