最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论
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 question

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=".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 question

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/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 badges
Add a comment  | 

2 Answers 2

Reset to default 1

This 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

发布评论

评论列表(0)

  1. 暂无评论