How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Forrest Pykes Jul 6, 2025

Did you know that your WordPress site may set cookies on your visitors' browsers? Other regulations, such as the European Union's General Data Protection Regulation (GDPR), require websites to obtain user consent before setting any cookies on their computers.

The good news is that in WordPress you can easily set up Cookie Consent using different plugins. We tested several tools and deployed them on our own website and found that the best options were WPConsent and Cookie Notice.

In this article, we will show you how to add a cookie popup in WordPress.

Why do I need a cookie pop-up?

Browser cookies are small files containing data that are sent by a website and stored in a user’s browser. Most WordPress websites set cookies for various purposes.

For example, by default WordPress uses cookies for authentication to store session information for logged in users. It also sets cookies when someone leaves a comment on your site.

In addition to this, WordPress plugins can also set their own cookies to store different information or identify repeat visitors.

While cookies are very useful, they can also be used to collect information about users and share it with third-party advertising platforms.

Therefore, in Europe and some other countries, website owners must inform users about their use of cookies. If your website is targeted at audiences in these regions, you will need to display a cookie consent disclaimer.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

The easiest way to do this is to use a WordPress GDPR plugin. WPConsent and Cookie Notification are two of the most popular cookie notification plugins and are compatible with many other popular WordPress plugins.

Having said that, let’s take a look at how to easily display a cookie consent popup in WordPress.

  • Method 1: Add Cookie Popup Using WPConsent (Recommended)
  • Method 2: Add a Cookie Popup with Cookie Notification
  • Bonus: Improve GDPR Compliance with MonsterInsights

Method 1: Add Cookie Popup Using WPConsent (Recommended)

The best way to add a cookie popup to your WordPress site is to use WPConsent .

WPConsent lets you easily create custom cookie consent popups and banners to match the design of your website.

Additionally, unlike most cookie notification plugins that simply display a warning, WPConsent actually protects user privacy by automatically blocking all tracking scripts and cookies until the visitor consents. This helps ensure your site is properly compliant with GDPR regulations.

**Note: **WPConsent has a free version available. However, this tutorial will use the Pro version as it has more advanced features.

First, you need to install and activate the WPConsent plugin. If you need help, then see our step by step guide on how to install a WordPress plugin .

Once the plugin is activated, a simple Getting Started wizard will start. Click the "Get Started Now" button to set up the plugin in less than 5 minutes.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

First, you need to copy and paste your license key into the License Key field and click on the Verify Key button. You can find your license key in the account area of your WPConsent website.

After verifying your license key, click on the Scan Your Website button.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

WPConsent will then scan your entire site for known third-party scripts, core functions, and WordPress plugins that may use cookies.

Once the scan is complete, WPConsent will notify you of the number of services that found cookies set. Click the "OK" button to view them.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Now you can see which services are using cookies on your website. On our test site, it shows that WordPress Comments and WPForms are using cookies.

Click the Auto-Configure Selected button to automatically import and configure all cookies and privacy information for detected services, including their descriptions, cookie duration, and data policy URLs.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Now that the cookie data has been configured, you can choose the layout and location of the cookie pop-up or banner that appears on your website.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Once you've selected a layout, you can scroll down the page to preview what it will look like.

If you are happy with your cookie banner design, you can click “Save and finish setup.” Alternatively, you can select “Further configure banner style” to customize your cookie popup, which this tutorial will teach you how to do.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Customize your cookie popup notifications

Clicking on ‘Configure banner style further’ will take you to WPConsent » Banner Design page.

From here, you can change the style of the cookie popup, including background color, text color, font size, button type, button color, and more.

Don’t forget to click on the Save button to store your styling changes.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

You can then click on the Content tab to customize the Cookie pop-up message. You can also scroll down the page to edit the button text, change the button order, and upload a logo or icon.

If you are satisfied with your design, click on the Save button.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Now you can visit your WordPress site to see your cookie popup in action.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Adding a Cookie Policy to Your WordPress Site

You should also add a cookie statement to your website’s privacy policy. If you haven’t created a privacy policy page yet, you can follow our guide to create a privacy policy page in WordPress.

WPConsent makes creating a cookie policy easy. It automatically scans your website, detects all active cookies, and then generates a detailed cookie policy documenting the purpose, duration and type of each cookie.

To configure the cookie policy, go to WPConsent » Dashboard from the WordPress admin area and click on the Configure button next to Cookie Policy.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

This will direct you to the Settings page of WPConsent. From here, scroll down the page and find the Cookie Policy section.

You can select the page you want to use for your Cookie Policy from the drop-down menu. In this tutorial, we will add a Cookie Statement to our Privacy Policy page.

You will also need to copy the shortcode provided by WPConsent.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Don’t forget to click the ‘Save Changes’ button at the bottom of the page.

Next, you simply edit your privacy policy page and insert the shortcode where you want the cookie statement to appear.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

To view the cookie statement, you need to save and preview the page. Here is how the first few paragraphs of content appear on the test site:

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Method 2: Add a Cookie Popup with Cookie Notification

You can also add a cookie popup in your WordPress site using Cookie Notification. This is a free plugin that is easy to use. However, it is not as feature-rich as WPConsent.

First, you need to install and activate the Cookie Statement & GDPR / CCPA Compliance plugin. For more details, see our step by step guide on how to install a WordPress plugin .

Upon activation, the plugin will immediately display a basic cookie popup to your visitors without any additional configuration. The default message is suitable for most websites.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

If you want to customize your notifications, then you need to visit the Cookies menu item in your WordPress dashboard .

From here, just scroll down to the “Notification Settings” section.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

On this page, you can customize the popup message and button text.

You can also add a link to your privacy policy page. If you don’t have one yet, you can follow our guide on creating a privacy policy page in WordPress.

You can then select that page from the Privacy Policy drop-down menu.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

The WordPress cookie plugin also provides your visitors with the option to refuse and withdraw consent.

To do this, simply click the "Deny consent" and "Withdraw consent" checkboxes. The default settings are suitable for most websites.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

If you scroll down to the Notification Design section, you can choose the position, animation, button style and color of the cookie consent popup.

You can also set the button class to add custom CSS for the popup.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Once you are done, click on the ‘Save Changes’ button at the end to store your settings.

You can now visit your website to see your cookie consent popup in action.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Bonus: Improve GDPR Compliance with MonsterInsights

MonsterInsights is the best analytics solution for your WordPress website. It’s also the easiest way to improve compliance with GDPR and other privacy regulations.

That’s because MonsterInsights offers an EU compliance add-on right out of the box. It automatically changes your analytics settings to help you comply with privacy laws.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

The premium plan includes the EU Compliance plugin. Best of all, it automatically integrates with Cookie Notice and Cookiebot.

The first step is to install the MonsterInsights plugin and connect it to your Google Analytics account. For more information, see our guide on how to install Google Analytics with MonsterInsights .

After installing and setting up MonsterInsights, you need to install and activate the EU Compliance plugin.

You can do this by navigating to the ‘Insights’ » ‘Plugins’ page in your WordPress dashboard . Next, find the ‘EU Compliance’ plugin and click on the ‘Install’ button.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

The plugin will be automatically activated.

You can check this by going to MonsterInsights » Settings page and switching to the Engagement tab.

When you look at the EU Compliance section, you will see that the plugin is turned on.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

If you click on the down arrow on the right side of the screen then you can see a detailed list of the configuration changes the plugin has made to your website.

For example, you can see that it automatically anonymizes IP addresses in Google Analytics , disables demographics, interest reporting, disables UserID tracking, and more.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

Next, you can scroll down to see MonsterInsights’ compatibility with different cookie plugins like Cookie Notification and CookieBot.

If you have any plugins installed on your website, MonsterInsights will automatically change the Google Analytics tracking code. This way, it will wait for your consent before tracking users in Google Analytics.

How to Add a GDPR/CCPA Compliant Cookies Popup in WordPress

We hope this article helped you add a cookie consent popup in your WordPress site.

If you liked this article, you can also share it on Twitter and Facebook.

Disclosure: Some of the links in this article contain affiliate links, which means we may earn a commission if you click through to visit us, at no extra cost to you. See how SidelinePlay is funded, why it’s important, and how you can support us.

Was this helpful?

0/400

Get free tips and resources right in your inbox, along with 60,000+ others