Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable all cookies set by a plugin in WordPress until a consent is provided

Is there a way to add a function or something else in WordPress so that all first-party cookies for guests (let's assume that there are no public user registrations) are disabled until consent is given by the user?

And if this consent is withdrawn the cookies should be expired automatically.

For example wpDiscuz cookies (and other comment form cookies for different plugins) and etc.

The idea is that such a solution should prevent WordPress and its plugins to set cookies without explicit consent.

like image 942
D.Angelov Avatar asked Dec 14 '17 11:12

D.Angelov


People also ask

How do I block cookies before consent?

THE HARD WAY: CODE IT ALL YOURSELF! Identify all scripts on your site that set cookies, write a script that blocks cookies from being set until your user has given an explicit consent and implement it in your website's source code – voilà.

How do I disable cookies on WordPress?

The only way to disable cookies and anything related to them on your WordPress.com website would be to upgrade to one of their paid plans. If you upgrade to one of WordPress.com's paid hosting plans you could disable all the cookies you like and have full control and autonomy over your WordPress website.

Does WordPress need cookie consent?

WordPress cookie consent. Because the GDPR gives users more control over their data, businesses that use cookies on their websites must secure cookie consent from visitors. If you have website visitors from the EU, you're responsible for staying compliant.


1 Answers

If you want to use a plugin for this reason, there is a very good one, called:
Cookiebot | GDPR/CCPA Compliant Cookie Consent and Control
but in free version you could have only 5 pages. More than 5 pages, you must buy a monthly subscription. I use this plugin for companies sites, small businesses e.t.c.

Another solution you may like and I use a lot, is this plugin:
GDPR Cookie Consent

This addon has a "Necessary" and "Non-necessary" options, that you could have the appropriate scripts you may have. Furthermore, every one of these choices have a header - footer section. Thus, your scripts could copy - paste inside these sections. After that, if user press "Accept" button for cookies, all these scripts would be loaded!

hope these info helps!

like image 122
Kiriakos Grhgoriadhs Avatar answered Oct 17 '22 17:10

Kiriakos Grhgoriadhs