Title: Block custom script before cookie agree with type=&#8221;text/javascript&#8221;
Last modified: November 25, 2024

---

# Block custom script before cookie agree with type=”text/javascript”

 *  Resolved [Jestemzmiasta](https://wordpress.org/support/users/jestemzmiasta/)
 * (@jestemzmiasta)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/block-custom-script-before-cookie-agree-with-typetext-javascript/)
 * Hello!
 * The answer posted here helped me a lot: [https://wordpress.org/support/topic/block-custom-script-before-cookie-agree/](https://wordpress.org/support/topic/block-custom-script-before-cookie-agree/).
   I know that when I insert a script and add <script type=”text/plain” data-category
   =”preferences”> to it, it will lock it nicely without consent. However, I have
   a script from a third party that has the src=”” specified in its structure. And
   I can’t use type=”text/plain”. The problem is that complianz doesn’t block script
   if I have text/javascript. So it only blocks at text/plane. Please help. Thank
   You.

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

 *  Plugin Support [Antonio Candela](https://wordpress.org/support/users/antoiub/)
 * (@antoiub)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/block-custom-script-before-cookie-agree-with-typetext-javascript/#post-18168150)
 * Hello [@jestemzmiasta](https://wordpress.org/support/users/jestemzmiasta/) ,
   
   In this case, you can overcome this by implementing the script with a plugin 
   like WP Code and blocking it before consent. Use the “Block a script, iframe 
   or plugin” feature of the Script Center to block it prior to consent, using the
   URL inside the `src` attribute. You can learn more about the features of the 
   script center at this link: [https://complianz.io/integrating-plugins/](https://complianz.io/integrating-plugins/)
 * Hope this helps.
 *  Thread Starter [Jestemzmiasta](https://wordpress.org/support/users/jestemzmiasta/)
 * (@jestemzmiasta)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/block-custom-script-before-cookie-agree-with-typetext-javascript/#post-18169116)
 * You gave me a fantastic thought. I simply used “Block script, iframe or plugin”
   and provided the address from the url. And it works as it should!
 * I only have one more request. There are only two categories to choose from – 
   Statistics and Marketing. I rather consider the cookies I have to be in the preferences
   category. I have just assigned <script type=”text/plain” data-category=”preferences”
   > to set them in preferences and in the second sollution by locking url I cannot
   select the prefs option. Can we do anything about it? Thank you very much!
 * P.S. i know the prefs options are treated as technical cookies and most common
   do not require consent. The problem is that I may want to use Marketing and Statistics
   in the future and I prefer not to use them for this particular case.
    -  This reply was modified 1 year, 6 months ago by [Jestemzmiasta](https://wordpress.org/support/users/jestemzmiasta/).
 *  Plugin Support [Antonio Candela](https://wordpress.org/support/users/antoiub/)
 * (@antoiub)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/block-custom-script-before-cookie-agree-with-typetext-javascript/#post-18169417)
 * Hello [@jestemzmiasta](https://wordpress.org/support/users/jestemzmiasta/) ,
 * I’m glad this helped you right away. I’m sorry to inform you that it is not possible
   to assign the Preferences category when blocking the script in the Script Center
   due to how it’s designed to work.
 * I hope this will still help you.
 *  Thread Starter [Jestemzmiasta](https://wordpress.org/support/users/jestemzmiasta/)
 * (@jestemzmiasta)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/block-custom-script-before-cookie-agree-with-typetext-javascript/#post-18169699)
 * It helped me a lot. Thank You!

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

The topic ‘Block custom script before cookie agree with type=”text/javascript”’ 
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/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jestemzmiasta](https://wordpress.org/support/users/jestemzmiasta/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/block-custom-script-before-cookie-agree-with-typetext-javascript/#post-18169699)
 * Status: resolved