WPConsent includes a powerful automatic script blocking feature that helps protect your visitors’ privacy by controlling when and how third-party scripts load on your website. This guide explains how this feature works and what it means for your website.
What is Automatic Script Blocking?
When you add tools like Google Analytics, Facebook Pixel, or other tracking scripts to your website, they start collecting data as soon as a visitor lands on your page. WPConsent’s automatic script blocking feature prevents these scripts from loading until your visitor has given their consent, improving GDPR compliance.
How Does It Work?
- Script Detection: WPConsent automatically identifies common third-party scripts on your website, including:
- Analytics tools (Google Analytics, Matomo, Clarity)
- Marketing pixels (Facebook, LinkedIn, TikTok, Pinterest)
- Other tracking scripts
- Categorization: Each detected script is automatically categorized as either:
- Statistics (for analytics tools)
- Marketing (for advertising and marketing pixels)
- Blocking: When a visitor first arrives on your site:
- The scripts are temporarily blocked
- They’re only activated after the visitor gives consent for the relevant category
- This happens automatically – you don’t need to modify any code.
How to Enable Script Blocking
- Go to your WordPress dashboard.
- Navigate to WPConsent settings.
- Find the “Script Blocking” option.
- Toggle it on & click Save Changes.
- That’s it! Automatic Script Blocking is now enabled.

Troubleshooting
If you need to check if script blocking is working:
- Open your website in an incognito/private browsing window
- Right-click and select “View Page Source”
- Look for scripts with `type=”text/plain”` and `data-wpconsent-category` attributes – these are being properly blocked
Supported Scripts
WPConsent automatically recognizes and blocks many popular services:
Statistics Category
- Google Analytics
- Matomo
- Clarity
- Clicky
Marketing Category
- Facebook Pixel
- Google Ads
- LinkedIn Insight
- X (formerly Twitter) Pixel
- Pinterest Tag
- Snapchat Pixel
- TikTok Pixel
Need Help?
If you’re experiencing issues or have questions about script blocking, please:
- Check if your script is in the supported services list.
- Ensure the feature is enabled in your settings.
- Contact our support team if you need further assistance.