← Back to Blog
How-ToMarch 22, 2024· 5 min read

How to Add a Cookie Consent Banner to Your WordPress Site

If your WordPress site uses Google Analytics, Facebook Pixel, or any third-party script, you need a cookie consent banner. Here's how to do it properly — without plugins that slow your site down.

Why WordPress Sites Need Cookie Banners

WordPress powers 43% of all websites. Most of those sites use at least one tracking script — Google Analytics alone is on over 55% of all WordPress installs. Under GDPR, DPDPA 2023, and CCPA, loading those scripts before getting user consent is a legal violation.

The fine? Up to €20 million or 4% of annual turnover under GDPR. India's DPDPA penalties are still being finalized, but regulators have made clear that enforcement is coming.

Option 1: Plugin (Easy, But Slow)

Popular options like CookieYes, Complianz, and GDPR Cookie Consent work but add 200–400ms to page load. If your site is already slow, this matters.

Steps: 1. Install the plugin from WordPress.org 2. Run the cookie scan 3. Set up your consent categories 4. Publish your cookie policy

Option 2: CookieSeal Script (Faster)

CookieSeal works on any website including WordPress — no plugin required.

1. Sign up at cookieseal.in 2. Add your domain and run the cookie scanner 3. Copy the one-line script snippet 4. Add it to your WordPress header via Appearance → Theme File Editor → header.php, or use a plugin like Insert Headers and Footers

That's it. The banner loads async so it doesn't block your page render.

What to Check After Setup

- Open your site in an incognito window — the banner should appear immediately - Click "Accept All" and reload — no banner on second visit - Click "Reject" — Analytics and marketing scripts should not fire - Check your cookie policy page is linked in the banner

One Thing Most Site Owners Miss

Your cookie policy must list every cookie your site sets — name, provider, purpose, and expiry. CookieSeal generates this page automatically from your scan results. Without it, your banner is incomplete and you're still not compliant.

Ready to get compliant?

Start with CookieSeal free — no credit card required.

Get Started Free