How to block cookies and trackers with JavaScript rewrite
This guide explains you how to block cookies and plugins with Secure Privacy using Javascript rewrite.
To block cookies and trackers you need to change the attributes of the script tags on your website. Follow these steps to change the attributes.
- Apply the attribute sp-consent="PLUGIN NAME" to the script/image tags on your website. Depending on where you have installed the plugins, this may be inside a module, plugin or directly on your website. Make sure that you write the exact plugin name, which appears on your Scan Report.
- On script tags change the attribute 'type' from 'text/javascript' to 'text/plain'.
- If you are using a pixel tracker (image trackers), then change the attribute “src” from “src” to “data-src”.
Here is an example of how it would look after you have modified a Google Analytics script.
Normal script tags look like this:
<script type="text/javascript"> code…
</script>
Using script type re-writing, you need to change the scripts to:
<script type="text/plain" sp-consent="Google Analytics"> code…
</script>

White-Label Consent Management: Add a CMP to Your Offering, Fast
Your clients are asking about privacy compliance, and you're probably losing deals to competitors who offer complete cookie consent solutions. If you're an agency, SaaS platform, or IT service provider watching clients struggle with GDPR and privacy requirements, you're missing a massive revenue opportunity that's right in front of you.
- Legal & News
- Data Protection

What Is a Consent Management Platform? (And Why You Need One)
Your website probably has more tracking technologies than you realize, and each one could be a compliance violation waiting to happen. If you're still managing cookie consent with basic banners or generic templates, you're missing the bigger picture of what modern privacy compliance actually requires.
- Legal & News
- Data Protection

Privacy Policy Generator: Create Compliant Policies in Minutes, Not Hours
Every business that collects personal data needs a comprehensive privacy policy. A Privacy Policy Generator is the fastest way to create legally compliant policies that meet GDPR, CCPA, and other regulatory requirements.
- Legal & News
- Data Protection