Title: Problem with Cloudflare
Last modified: August 21, 2016

---

# Problem with Cloudflare

 *  [vaibhavbthl](https://wordpress.org/support/users/vaibhavbthl/)
 * (@vaibhavbthl)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/problem-with-cloudflare/)
 * Hi
 * Thanks for this awesome plugin. When i activate rocket loader in cloudflare then
   the images load after 8-10seconds and many times they don’t load at all so i 
   want to exclude lazy load javascript from it. I saw on cloudflare website that
   to exclude certain javascripts i should add <script data-cfasync=”false” src=”/
   javascript.js”></script> before the script. My question is where should i add
   this code to exclude this plugins’ script?
 * Regards
    Vaibhav
 * [http://wordpress.org/plugins/bj-lazy-load/](http://wordpress.org/plugins/bj-lazy-load/)

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

 *  Thread Starter [vaibhavbthl](https://wordpress.org/support/users/vaibhavbthl/)
 * (@vaibhavbthl)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/problem-with-cloudflare/#post-4566000)
 * Hi
 * Can anyone help me with this issue. I also emailed cloudflare and got the following
   response – You would need to speak with the author of that particular plugin.
   Normally it will be an edit in one of the PHP files that the plugin uses.
    Any
   help is appreciated.
 * Regards
    Vaibhav
 *  [happyches](https://wordpress.org/support/users/happyches/)
 * (@happyches)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/problem-with-cloudflare/#post-4566088)
 * I have the same problem with Cloudflare.. my “tooltips” are showing my placeholder
   image. The rest of my content loads fine though.
 * Are you having problems with “all” images? If so, try choosing “no” for
    1.) 
   Load hiDPI (retina) images and 2.) Load responsive images
 * In the meantime, I’m very interested in how to get my tooltip images working 
   with Cloudflare and BJ Lazy Load too, and excited that you have got further than
   I have with troubleshooting, so I’ll have a look and see where I might put that
   code and update if I find the right bit 🙂
 *  [happyches](https://wordpress.org/support/users/happyches/)
 * (@happyches)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/problem-with-cloudflare/#post-4566089)
 * I thought it was the same problem, but we have different problems. I’m not using
   RocketLoader.
 * Here is a detailed answer on how to do what you want though:
 * [http://wordpress.stackexchange.com/questions/50457/how-do-i-add-custom-attributes-to-javascript-tags-in-wordpress/90156#90156](http://wordpress.stackexchange.com/questions/50457/how-do-i-add-custom-attributes-to-javascript-tags-in-wordpress/90156#90156)
 * You add the code in your theme’s function.php
 * The only problem with that code though, is that it seems you have to add a list
   of all the .js files you want to optimize? But maybe it will work if you just
   add what you don’t want to optimize…
 * So if I was using Rocket Loader, I would first be trying something like this 
   in my themes function.php:
 *     ```
       function rocket_loader_attributes( $url )
       {
           $ignore = array (
                'http://mydomain.com/wp-content/plugins/bj-lazy-load/js/combined.min.js',
           );
           if ( in_array( $url, $ignore ) )
           { // this will be ignored
               return "$url' data-cfasync='false";
           }
   
           return $url;
       }
       add_filter( 'clean_url', 'rocket_loader_attributes', 11, 1 );
       ```
   
 * But if that doesn’t work, then you might have to add the full script at that 
   url, with all the js files you want to optimize, which sounds like too much drama.

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

The topic ‘Problem with Cloudflare’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bj-lazy-load_9084ba.svg)
 * [BJ Lazy Load](https://wordpress.org/plugins/bj-lazy-load/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bj-lazy-load/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bj-lazy-load/)
 * [Active Topics](https://wordpress.org/support/plugin/bj-lazy-load/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bj-lazy-load/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bj-lazy-load/reviews/)

## Tags

 * [cdn](https://wordpress.org/support/topic-tag/cdn/)

 * 3 replies
 * 2 participants
 * Last reply from: [happyches](https://wordpress.org/support/users/happyches/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/problem-with-cloudflare/#post-4566089)
 * Status: not resolved