Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • @kazifdev, the reason I created the snippet is because I was able to reproduce the issue manually.

    In my case, the CSS remained broken until I purged the caching plugin’s cache. That made it pretty clear that the problem wasn’t simply Elementor failing to generate the CSS, but that the caching layer was still serving pages that referenced CSS files Elementor had already removed or regenerated.

    Btw, I suggest using a snippets plugin instead of adding this directly to functions.php. It’s lightweight and makes testing, disabling and managing snippets much easier.

    Also make sure there is no other caching mechanism running. For example, your hosting provider may have server-side caching enabled. I would also double-check other plugins for caching, optimization, CSS minification or asset optimization features.

    I don’t think I would simply wait for an Elementor update at this point. Elementor V4 may change when and how assets are generated, but the underlying problem still appears to be a synchronization issue between Elementor regenerating/removing CSS files and another caching layer continuing to serve references to the old files.

    In your case, I would first try to determine two things:

    1. When exactly does it break?
      Try to find an action you can perform manually that reliably reproduces the problem.
    2. What exactly fixes it?
      Keep DevTools open and check which CSS files return 404s. Then see whether purging Elementor’s cache, the caching plugin, server cache, or another optimization layer makes those requests disappear.

    If you can reproduce something like:

    working page, clear/regenerate Elementor CSS, page requests old CSS, 404, purge caching plugin, working again

    then you have a much more useful starting point than simply waiting for an Elementor update.

    And like @miloss84 said, we’re both on paid plans. Open a support ticket with Elementor and have them take a look with you. There’s a good chance their support team has encountered similar combinations of Elementor, caching plugins and server-side caching before.

    add_action( 'elementor/core/files/clear_cache', function () {
    if ( function_exists( 'w3tc_flush_all' ) ) {
    w3tc_flush_all();
    }
    } );

    Or you can use the page cache reset which also works and is less ‘agressive’:

    add_action( 'elementor/core/files/clear_cache', function () {
    if ( function_exists( 'w3tc_pgcache_flush' ) ) {
    w3tc_pgcache_flush();
    }
    } );


    I stepped over from ‘fastest cache’ to ‘w3 total cache’ and the problem persisted.

    So i am now using a hook on elementor’s clear_cache that wil also trigger a cache plugin purge for w3. This has solved my issue after testing for now.

    Just for future reference if this has indeed solved an issue i’ve included 3 most common caching plugins here:

    add_action( 'elementor/core/files/clear_cache', function () {

    /*
    * W3 Total Cache
    * Alleen page cache. (should be sufficient)
    */
    if ( function_exists( 'w3tc_pgcache_flush' ) ) {
    w3tc_pgcache_flush();
    return;
    }

    /*
    * LiteSpeed Cache
    * Purge LSCache page-cache entries.
    */
    if ( has_action( 'litespeed_purge_all' ) ) {
    do_action( 'litespeed_purge_all', 'Elementor regenerated CSS files' );
    return;
    }

    /*
    * WP Fastest Cache
    * normal cache,not minified CSS/JS-cache.
    */
    if ( class_exists( 'WpFastestCache' ) ) {
    $wpfc = new WpFastestCache();

    if ( method_exists( $wpfc, 'deleteCache' ) ) {
    $wpfc->deleteCache();
    }
    }

    } );
    • This reply was modified 2 days, 12 hours ago by Rik.
    • This reply was modified 2 days, 12 hours ago by Rik.

    I can confirm this issue.

    This seems to happen when Elementor-generated CSS files are removed or regenerated, while a cache plugin still serves old cached HTML that references those old CSS files.

    In my case, right after using Elementor → Tools → Clear Files & Data, the page breaks.

    DevTools shows:

    /wp-content/uploads/elementor/css/post-3045.css?ver=1788942798
    Request Method: GET
    Status Code: 404 Not Found

    And also:

    /wp-content/uploads/elementor/css/post-4726.css?ver=1788942799
    Status Code: 404 Not Found

    If I purge the caching plugin cache after clearing Elementor cache, the page works again.

    So the problem is not simply “CSS not loading”. The cached HTML is still pointing to Elementor CSS files that no longer exist.

    This makes the issue appear random for visitors, because some visitors may receive an old cached HTML version while the referenced Elementor CSS file has already been deleted or regenerated.

    I’m currently using W3 Total Cache, but I previously saw similar behavior with WP Fastest Cache.

    The main concern is that clearing Elementor files/data can break cached pages unless all page caches are purged immediately afterwards.

    Elementor should probably either keep old generated CSS files available for longer, regenerate required CSS before removing old files, or provide a clear automatic hook/integration for cache plugins to purge page cache when Elementor CSS files are cleared.

    Thread Starter Rik

    (@rikdol)

    That seems like an awful lot to shutdown on a live site, for one field that doesn’t get its value sent.

    I will first check what information is inside the array upon the mailsent event. Because when I add any field there’s no problem, until it’s a select field.

    Don’t get me wrong, I read your reference, but can’t pull the site offline atm.

    I will report back if it doesn’t work, or when I disabled the theme and plug-ins.

    Thread Starter Rik

    (@rikdol)

    Several, listed below.

    to point out, the subject ‘field’, when filled, is getting sent. it’s only the ‘select’ that doesn’t.

    Theme:
    Generatepress
    Plugins :
    Wordfence, WP Fastest Cache, Rank math, Code snippets, Contactform 7, Flamingo, Lightweight Social Icons, Generateblocks (Generatepress), Simple Google reCAPTCHA, Smart Slider 3, Elementor (pro), Rank Math SEO, WP Mail SMTP

    Thanks for helping out

    Thread Starter Rik

    (@rikdol)

    to add to this it may be important to mention.

    when submitting the form it doesn’t matter if i ‘touched’ any of the options. this happens without me actually clicking something in the select box, and happens also when i keep it on default 1

    Thread Starter Rik

    (@rikdol)

    Hi Peter,

    Thanks for your elaborate response.

    Just for my information, are the IP addresses you’re whitelisting for 2FA definitely confirmed as static IPs?

    Yes, the IP’s are confirmed since I also use my home IP to host other things that need to be accessible from the web. Those are confirmed, also with the site you suggested. So there is no reason for me to think they’re wrong, but I double-checked anyways 🙂

    If the above doesn’t give us any solid reasons why this is happening, can you send a diagnostic report

    I’ve just sent the report from diagnostics using this forum’s username: @rikdol.

    so in the console, you’d be wanting to look for red Javascript errors, or the network tab reporting any failed page loads.

    I can’t see errors in the console during the login phase.
    After entering the username/password it will prompt me for the authenticator code. Which is tedious when I’m working from home.

    I responded a bit late since I didn’t get notified of a response. ill be watching the thread more closely 🙂

    Thread Starter Rik

    (@rikdol)

    het probleem is vanzelf opgelost, mogelijk een fout in cache van chrome ondanks ctrl+f5.

Viewing 8 replies - 1 through 8 (of 8 total)