#elementor

[ follow ]
fromSitePoint Forums | Web Development & Design Community
1 week ago

How I excluded specific CSS files from optimization in WordPress using a simple filter

I ran into a situation where some CSS files from Elementor were breaking when optimization/minification was applied globally. Instead of disabling optimization completely, I used a small snippet to exclude only specific CSS files while allowing others to remain optimized. I added this using the Code Snippets plugin and ran it everywhere. Here is the code: add_action('wp_enqueue_scripts', 'bhavin_remove_unused_elementor_css', 100); function bhavin_remove_unused_elementor_css() { // Check if Elementor is active if (!did_action('elementor/loaded')) { return; }
Web development
#css
[ Load more ]