Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionIn 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=".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.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionIn 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/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.
Share Improve this question asked Oct 28, 2019 at 6:24 Rahul KumarRahul Kumar 2074 silver badges20 bronze badges2 Answers
Reset to default 1This helps me to solve the problem:
https://snifflevalve/elementor-tutorials/elementor-cloudflares-rocket-loader-not-play-well-together/
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