What is Script Blocking? #
Script blocking is a crucial feature for achieving legal compliance with privacy laws. It prevents third-party scripts from running on a website and setting cookies before a user has given explicit consent. Without this feature, a website might be in breach of regulations by collecting user data without permission, even if a cookie consent banner is present.
The WPLP plugin provides this functionality to ensure that your website respects user privacy from the moment they land on your page.
How to Use the Script Block Feature #
Follow these steps:
- Log in to your WordPress Dashboard. Navigate to Cookie Consent.
- Click on the Script Blocker tab. This will take you to the main script blocker configuration page.
- Now, let’s see what happens when the script is off.
- Now, when a user visits your site, they will be able to see the video regardless of whether they have given consent or not.
- However, if you have enabled the script blocker, someone visiting your site won’t be able to see the video until consent is given.
- In this example, we have assigned an unclassified cookie to the YouTube video. This means that when the visitor accepts the unclassified cookie, they will be able to watch the video.
- Additionally, if you want to add any extra scripts, you can insert them in the header, body, or footer section of your site.
- Once you have added all the scripts, make sure to save your changes.
Script dependency: Script dependency refers to a situation where one script relies on another script to function correctly.
As you can see, there is an option to specify which scripts depend on others.
Whitelist Script: A whitelist script is a script that you allow to run on your site regardless of user consent settings. Adding a script to the whitelist will always execute, even if other scripts are blocked by the script blocker.
- Navigate to the Whitelist Scripts tab.
- Look for a button to Add New Entry.
- Enter the script’s URL and the name of the script.
- Save the new whitelisted script.
When you add a script to the whitelist, it will always run on your website, even if the user has not given consent.