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>

What is Cookie Consent? A Quick 2026-Ready Glance
Your website loads. Cookies track users. But without proper cookie consent, you're violating GDPR — risking fines up to €20 million or 4% of global revenue. Cookie consent is the legally required mechanism by which websites obtain explicit user approval before deploying non-essential tracking technologies. This requirement stems from GDPR Article 4(11) and the ePrivacy Directive, mandating that consent must be freely given, specific, informed, and unambiguous.
- Legal & News

DSAR Tools Explained: Best Software for Automating Privacy Requests
You're drowning in data subject access requests. Manual searches through dozens of systems miss regulatory deadlines and expose organizations to fines starting at $2,500 per violation. The solution? DSAR tools — purpose-built software that automates the entire process of responding to data subject access requests, from intake to delivery.
- Legal & News

IAB TCF 2.3 Explained: Requirements, Updates, and Implementation Guide (2026)
Your ad revenue dropped 40% overnight. Google stopped bidding on your inventory. Your DSP partners flagged your traffic as non-compliant. The culprit? An outdated TCF 2.2 consent string after the February 2026 enforcement deadline.
- Legal & News
- Cookie Consent