Title: Auto block doesn&#8217;t work + fix
Last modified: April 17, 2018

---

# Auto block doesn’t work + fix

 *  Resolved [Website Academy](https://wordpress.org/support/users/rfmcomposer/)
 * (@rfmcomposer)
 * [8 years ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/)
 * I enabled the auto block function, but Youtube videos were still embedded.
 * I found this old thread:
 * [https://wordpress.org/support/topic/autoblock-function-isnt-working-anymore/](https://wordpress.org/support/topic/autoblock-function-isnt-working-anymore/)
 * I applied this fix in class-frontend.php (starting from line 182):
 *     ```
       function ecl_buffer_start() { ob_start(/*"ecl_callback"*/); }
       function ecl_buffer_end() {
               $contents = ecl_erase(ob_get_contents());
               ob_end_clean();
               echo $contents;
       }
       ```
   
 * And now it works again.
 * Can you please add this fix to the next release so it keeps working?
 * Thanks!
 * Wouter

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

 *  Thread Starter [Website Academy](https://wordpress.org/support/users/rfmcomposer/)
 * (@rfmcomposer)
 * [8 years ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/#post-10191740)
 * And a feature request: it would be nice to have separate checkboxes to block 
   iframes and scripts.
 * I only want to block iframes.
 * When scripts are blocked, also the Google Analytics is blocked. This is not necessary
   because I don’t need permission for that (I use anonymize).
 *  Thread Starter [Website Academy](https://wordpress.org/support/users/rfmcomposer/)
 * (@rfmcomposer)
 * [8 years ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/#post-10212943)
 * [@milmor](https://wordpress.org/support/users/milmor/) I see there is a plugin
   update that didn’t include the fix I mentioned above. So now my website is not
   GDPR compliant anymore. Because video embeds are shown before cookies are accepted.
   Can you please include the code change above so my website stays GDPR comliant
   with the next update?
 * Thanks!
 * Wouter
 *  Plugin Author [Marco Milesi](https://wordpress.org/support/users/milmor/)
 * (@milmor)
 * [8 years ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/#post-10213139)
 * Releasing 2.13 right now 🙂
 *  Thread Starter [Website Academy](https://wordpress.org/support/users/rfmcomposer/)
 * (@rfmcomposer)
 * [8 years ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/#post-10213316)
 * [@milmor](https://wordpress.org/support/users/milmor/) Thanks!
 * The only thing that is missing to be GDPR compliant is the differentiation between
   iframes and scripts.
 * This is my solution for now:
 *     ```
               $content = preg_replace('#<iframe.*?\/iframe>|<object.*?\/object>|<embed.*?>#is', generate_cookie_notice('auto', '100%'), $content);
       //        $content = preg_replace('#<script.(?:(?!eucookielaw_exclude).)*?\/script>#is', '', $content);
       //        $content = preg_replace('#<!cookie_start.*?\!cookie_end>#is', generate_cookie_notice('auto', '100%'), $content);
       //        $content = preg_replace('#<div id=\"disqus_thread\".*?\/div>#is', generate_cookie_notice('auto', '100%'), $content);
       ```
   
 * But I have to apply this fix every time you update the plugin.
 * So it would be nice to have 4 different options:
    - block iframes
    - block scripts
    - block cookies
    - block disqus
 * Wouter
 *  [EnFi](https://wordpress.org/support/users/enfi/)
 * (@enfi)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/#post-10307382)
 * Hello!
    I use Eu Cookie Law plugin. I’ve wrapped all scripts (adsense, facebook
   widget, youtube etc) on my website with the shortcode [cookie]…[/cookie].
 * In this way every third party cookies are blocked.
    If the user accept the cookies
   they will see the website with all these scripts if they don’t accept they will
   see the website with the grey Eu Cookie Law little banner that says “Click accept
   if you want to see more”.
 * So, in this case there are no cookies installed on the browser of the users. 
   They can see the content of the website and navigate, but they will not see the
   youtube video etc…
 * 1) If they don’t accept cookies
    In this way I don’t need to record their consent
   and they can however see the website.
 * 2) They accept cookies
    If they accept, the consent is stored on the EuCookie
   on their browser.
 * Do you think that this approach could be legal, with the new GDPR regulation?
 * Thank you very much
 *  [ijbo](https://wordpress.org/support/users/ijbo/)
 * (@ijbo)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/#post-10309963)
 * How do you add the shortcode? What exactly needs to be written in-between the[
   cookie]…[/cookie] brackets? I need to do amazon, youtube and google analytics.
   I can’t just use Auto Block because then my slider doesn’t work.

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

The topic ‘Auto block doesn’t work + fix’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/eu-cookie-law_39293e.svg)
 * [EU Cookie Law for GDPR/CCPA](https://wordpress.org/plugins/eu-cookie-law/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/eu-cookie-law/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/eu-cookie-law/)
 * [Active Topics](https://wordpress.org/support/plugin/eu-cookie-law/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/eu-cookie-law/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/eu-cookie-law/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [ijbo](https://wordpress.org/support/users/ijbo/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/auto-block-doesnt-work-fix/#post-10309963)
 * Status: resolved