🆕  2025 U.S. State Privacy Laws: what you need to know

How to add a cookie consent banner for WordPress

Ensure your WordPress site complies with privacy laws like GDPR, CCPA. Learn to add a WordPress cookie notice easily with plugins or manual code setup.
Read time
3 min read
Last updated
December 20, 2024
Ketch is simple,
automated and cost effective
Book a 30 min Demo

Ensuring your WordPress website complies with privacy laws such as GDPR and CCPA is crucial. Adding a cookie banner is one of the best ways to stay compliant while maintaining user trust. In this guide, we’ll walk you through installing a cookie consent banner on your WordPress site using a simple and effective method.

‍

🎥 Need Extra Help? Watch this detailed video tutorial.

Why you need a cookie consent banner

A cookie popup informs visitors about your site’s data collection practices and allows them to accept or manage cookies. It’s essential for data privacy compliance and helps build transparency with your audience.

Read also: Wix cookie banner and Webflow cookie consent

Best ways to add a WordPress cookie banner

There are two common ways to add a WordPress cookie notification to your website:

  1. Using a cookie plugin (recommended for simplicity)
  2. Manual installation (for advanced users comfortable editing code)

We’ll walk you through the easier, recommended option so you don’t have to edit your theme functions.php.

‍


đź’Ş Need Extra Help? Follow this guided tour.

‍

How to add a cookie consent banner using WPCode plugin

If you prefer a straightforward way to add a cookie consent banner, use a WordPress plugin. In this tutorial we use the WPcode plugin.

What is a WordPress plugin?

A WordPress plugin is a software add-on that extends the functionality of your WordPress website. It allows you to add features like cookie banners, contact forms, SEO tools, and more without coding. Plugins are easy to install, making WordPress highly customizable and scalable.

Step 1: Install and activate the WPCode Plugin

  1. Log in to your WordPress Dashboard.
  2. Go to Plugins > Add New
  3. Search for "WPCode."
  4. Click Install Now and Activate

‍

wordpress plugin install
In your WordPress dashboard, go to Plugins, then Add a new Plugin.

‍

wordpress plugin wpcode
In Plugins, search for wpcode. Click Install Now and Activate.

‍

Step 2: Grab the Ketch Smart Tag

  1. Sign up for Ketch Free or log into your Ketch dashboard
  2. Navigate to the Properties screen
  3. Select the right property and click on Export Code
  4. Copy the Website Smart Tag code provided

‍

grab the ketch tag for your wordpress cookie banner
On the Properties screen, select the right property and click on Export Code.

‍

copy the tag for your cookie banner on wordpress
Copy the Website Smart Tag code provided.

‍

Step 3: Add the cookie banner code

  1. From the WordPress Dashboard, navigate to Code Snippets > Header & Footer
  2. In the Header section, paste the Ketch Smart Tag script (available from your Ketch Properties - see Step 2 above)

‍

wordpress header and footer
In your WordPress Dashboard, navigate to Code Snippets > Header & Footer.

‍

cookie banner code in header of wordpress
In the Header, paste the Ketch Smart Tag script.

Step 4: Save and deploy

  1. Click Save Changes to implement the cookie banner on your WordPress site
  2. Reload your website to see your cookie banner pop up

‍

save your wordpress cookie consent code
Click Save Changes to implement the cookie banner on your WordPress site.

‍

preview of wordpress cookie banner on your website
Reload your website to see your cookie banner pop up.

‍

“As a fast-growing but early-stage start-up operating across 3 regions (US, UK/EU, and Australia), Ketch was the obvious choice for us. Ketch made it easy to be compliant in all 3 regions, plugged straight into our website builder, and had excellent customer support. Thanks Ketch for making cookie consent banners easy!”

‍- Vivienne Chan, ‍Co-founder, Veraty

The free cookie banner and consent management you need, designed with you in mind

Growing small businesses get Ketch Free to achieve data privacy compliance at no cost, and with peace of mind.

Ketch offers a free, no-code cookie banner and consent management solution tailored for small businesses. It enables users to create customizable cookie banners that comply with privacy regulations such as GDPR and CCPA.

‍

‍

WordPress Cookie FAQs

Can I add a cookie banner on WordPress without a plugin?

Yes, but you’ll need to edit your theme’s functions.php file or use a custom script manually.

What is the best free cookie consent plugin for WordPress? 

Many top-rated plugins offer free versions. Ketch offers its own version of a free cookie banner too. Unlike your classic free cookie consent banners, Ketch Free offers full consent management platform (CMP) functionality. It positions you for success from day one and scales effortlessly at your side as your company and website traffic grows.

Read also: What is consent management?

Tell me more about GDPR and WordPress 

The General Data Protection Regulation (GDPR) is a European privacy law that affects websites worldwide if they collect data from EU residents. To comply with GDPR, WordPress site owners must disclose data collection practices, get user consent for cookies, and allow visitors to manage their preferences.

How do I add cookies notice in WordPress?

To enable a cookies popup in WordPress, install and activate the WPCode plugin from your WordPress Dashboard. Go to Code Snippets > Header & Footer, paste the Ketch Smart Tag code into the Header section, and click Save Changes. 

This will display a WordPress cookie notice on your site, ensuring GDPR compliance.

How to display WordPress cookie notice without any plugins?

To display a WordPress cookie notice without plugins, manually edit your theme’s functions.php or use Appearance > Theme Editor in your WordPress Dashboard. Add the cookie consent script inside the Header section before the closing <head> tag. Save the changes to display the cookie notice on your site.

‍

Read time
3 min read
Published
December 20, 2024
Get Started with Ketch Free Today

Start collecting consent in 5 minutes or less

Get Ketch Free Now
Need an easy-to-use consent management solution?

Ketch makes consent banner set-up a breeze with drag-and-drop tools that match your brand perfectly. Let us show you.

Book a 30 min Demo

Continue reading

Product, Privacy tech, Top articles

Advertising on Google? You must use a Google certified CMP

Sam Alexander
3 min read
Marketing, Privacy tech

3 major privacy challenges for retail & ecommerce brands

Colleen Barry
7 min read
Marketing, Privacy tech, Strategy

Navigating a cookieless future with Google Privacy Sandbox

Colleen Barry
7 min read
Get started
with Ketch
Begin your journey to simplified privacy operations and granular data control across the enterprise.
Book a Demo
Ketch was named top consent management platform on G2