My elementor is not opening in WordPress because of "cloudflare-static/rocket-loader.min.js"

In my WordPress website, I am using the Cloudflare and Elementor editor also but when I am trying to edit the page using the Elementor, my Elementor is not opening. I think it is because of the Cloudflare in my WordPress.

Cloudflare has added the script in the head and also in the footer:

script src="https://ajax.cloudflare.com/cdn-cgi/scripts/95c75768/cloudflare-static/rocket-loader.min.js" data-cf-settings="9838dd25b616f37c8176faa3-|49"/script

So, How to exclude the script from WordPress?

Added this in my functions.php

add_filter( 'script_loader_tag', function ( $tag, $handle ) {

if ( 'script-handle' !== $handle )
    return $tag;

return str_replace( "type='text/javascript' src", ' data-cfasync="false" src', $tag     );
}, 10, 2 );

But not working.

Also tried this by adding in the functions.php:

script data-cfasync=”false” src=”/javascript.js”/script

But not working.

Any help is much appreciated.

Topic cloudflare Wordpress

Category Web



Why you are using a filter? wp_enqueue_script() function would be much better. Anyways, Rocket Loader seems to be conflicting with some WP component, i.e Jetpack. Hope can help

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.