Skip to content

Why WPBakery’s Optimized CSS & JS Loading Is Disabled

In this article

    WPBakery 9.0 added “CSS loading” and “JS loading” settings, found under WPBakery → Settings. They offer three modes:

    • Legacy: loads WPBakery’s full CSS and JS bundles in the site header.
    • Optimized: loads a smaller base file, then adds each element’s own CSS and JS files as the element is rendered on the page.
    • Hybrid: uses optimized loading for posts created in WPBakery 9.0 or newer and legacy loading for older posts.

    When Total is active, WPBakery always uses legacy loading, so these settings are hidden from the WPBakery settings page.

    Why Total uses legacy loading

    In optimized mode, an element’s CSS isn’t loaded until that element is rendered. Content in the main post area may still get its styles in time. But much of a Total site is rendered after the <head> has already been sent to the browser, including:

    • Header Builder and Footer Builder templates.
    • Dynamic templates for posts, archives and custom post types.
    • Templates inserted with theme hooks or custom code snippets.
    • Templates inserted in theme areas such as the top bar, header aside or Widgets.
    • Templatera templates.

    Element styles for this content can’t be added to the <head> because it has already been output. They load later in the page instead. That can cause a flash of unstyled content (FOUC), where elements briefly appear unstyled before their CSS loads. Because the header loads first, the flash is easy to notice there.

    There’s no reliable way to know every element a page will use before it renders, especially content added by custom code or other plugins. Loading the full bundle in the <head> keeps every page consistent. The bundle is cached by the browser after the first page view, so the extra size has little effect on load time.

    Is this a performance concern?

    Not really. WPBakery’s optimized loading saves much less than it sounds like:

    • It doesn’t remove most of the CSS: Optimized mode still loads a large base stylesheet on every page, then adds a file for each element you use. Compared with the full bundle, it usually saves less than 100 KB gzipped, which is less than a single large image.
    • The full bundle is cached: It downloads once and is reused on every page after that, so most visitors never download it again.
    • It adds requests: Each element type gets its own stylesheet, so a page can load many small files instead of one cached one.
    • It adds work to every page: WPBakery checks the loading mode each time an element renders, looks up each element’s CSS and JS files on the server, and saves extra data to every post you edit.
    • JavaScript is already optimize: Total only loads WPBakery’s front-end JavaScript on pages that need it.

    For most sites the difference in load time is too small to notice, and the risk of a flash of unstyled content isn’t worth it. For real CSS savings, use a tool that removes unused CSS from the finished page, as described below.

    Optimizing your CSS correctly

    To reduce unused CSS on your site, use a caching or performance plugin that works on the final page output. For example, WP Rocket’s Optimize CSS Delivery feature offers:

    • Remove Unused CSS: strips CSS rules not used on each page.
    • Load CSS Asynchronously: inlines the critical CSS needed for the top of the page and defers the rest.

    These tools look at the fully rendered page, so they cover every template, builder area and hooked element. That makes them a better fit than WPBakery’s per-element loading.

    Even so, this is a minor optimization. For most sites the WPBakery stylesheet has little effect on load time, so start with images, caching and hosting, which usually make a much bigger difference. See our full guide on speeding up your WordPress site.

    Developers

    Total forces legacy mode by filtering the wpb_js_css_loading and wpb_js_js_loading options. Removing that override isn’t supported and will cause styling issues on your site.

    Related Articles
    Back To Top