Title: Block external image src &#8211; NEW
Last modified: February 23, 2022

---

# Block external image src – NEW

 *  Resolved [dobicki](https://wordpress.org/support/users/dobicki/)
 * (@dobicki)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/block-external-image-src-new/)
 * Hi there [@rogierlankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * I found this old thread. [https://wordpress.org/support/topic/block-external-image-src/](https://wordpress.org/support/topic/block-external-image-src/)
   
   However the git the final git link with the solution is not working any more.
 * [https://github.com/Really-Simple-Plugins/complianz-gdpr/tree/activate-blocked-images](https://github.com/Really-Simple-Plugins/complianz-gdpr/tree/activate-blocked-images)
 * Would you mind providing the solution again?
 * Kind regards
 * Raman
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fblock-external-image-src-new%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15396901)
 * This branch has been merged into the master, so is now part of the plugin. Do
   you have any specific issues with blocking images at the moment?
 *  Thread Starter [dobicki](https://wordpress.org/support/users/dobicki/)
 * (@dobicki)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15398453)
 * Hi Rogier.
 * Thank you for the quick feedback.
    Yes indeed I have this ratings widget right
   here. It loads a png from an external source and i would like to have that blocket.
 * I had been able to to add custom scripts to the script center before. That all
   worked splendidly. However with the images I am adraid I missed something.
 * [https://pflegeberatung-sattelberger.de/promedica/](https://pflegeberatung-sattelberger.de/promedica/)
 * Hope you can point me in the right direction.
 * Kind regards
 * Roman
 *  Plugin Contributor [Jarno Vos](https://wordpress.org/support/users/jarnovos/)
 * (@jarnovos)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15399241)
 * Hi [@dobicki](https://wordpress.org/support/users/dobicki/),
 * You can upload the attached code as a PHP file to the folder `/wp-content/mu-
   plugins/`, which will block the image (the one seen on the URL you attached) 
   prior to consent.
 * You can see an example in action on [this URL](https://majezu.us.instawp.xyz/index.php/2022/02/24/image-blocked/).
 *     ```
       <?php
   
       defined( 'ABSPATH' ) or die( "you do not have acces to this page!" );
   
       /**
       * Block the image
       *
       * @param $tags
       *
       * @return array
       */
   
       function cmplz_block_image_sources( $tags ) {
       	$tags[] = 'provenexpert.com';
   
       	return $tags;
       }
       add_filter( 'cmplz_image_tags', 'cmplz_block_image_sources' );
       ```
   
 * Hope it helps!
    Kind regards, Jarno
 *  Thread Starter [dobicki](https://wordpress.org/support/users/dobicki/)
 * (@dobicki)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15400398)
 * Hi Jarno.
 * Thank you so much. Now I understand how this works. 😀
 * Cheers
 * Roman
 *  Thread Starter [dobicki](https://wordpress.org/support/users/dobicki/)
 * (@dobicki)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15400469)
 * hm.
    Sadly it is still not working. Checkt the mu-plugins Path, checked your 
   code, cleared all the page cache.
 * Am I forgetting something?
 * _
 * Update:
    Weirdly enough now it works. I generated a new testpage, pasted the 
   widget code again, deleted and reuploaded the php file to the mu-plugins folder
   and now it does work. [https://pflegeberatung-sattelberger.de/test/](https://pflegeberatung-sattelberger.de/test/)
 * Must have been a cache problem after all.
 * Anyway many thanks for your help.
 * Kind regards
 * Roman
    -  This reply was modified 4 years, 3 months ago by [dobicki](https://wordpress.org/support/users/dobicki/).
 *  Plugin Contributor [Mathieu Paapst](https://wordpress.org/support/users/paapst/)
 * (@paapst)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15416158)
 * Hi [@dobicki](https://wordpress.org/support/users/dobicki/)
 * Great to hear that your issue is resolved! Could you tell us what you think of
   the plugin or the support by casting [your Review here](https://wordpress.org/support/plugin/complianz-gdpr/reviews/#new-post)?
   We’d love to hear your feedback!
 *  [webaffin](https://wordpress.org/support/users/webaffin/)
 * (@webaffin)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15900151)
 * It worked also for me! Also for an image of service “Proven Expert”.
 * Thanks much!
 * Robert

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

The topic ‘Block external image src – NEW’ is closed to new replies.

 * ![](https://ps.w.org/complianz-gdpr/assets/icon-256x256.png?rev=2881064)
 * [Complianz - GDPR/CCPA Cookie Consent](https://wordpress.org/plugins/complianz-gdpr/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/complianz-gdpr/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/complianz-gdpr/)
 * [Active Topics](https://wordpress.org/support/plugin/complianz-gdpr/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/complianz-gdpr/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/complianz-gdpr/reviews/)

## Tags

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

 * 7 replies
 * 5 participants
 * Last reply from: [webaffin](https://wordpress.org/support/users/webaffin/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/block-external-image-src-new/#post-15900151)
 * Status: resolved