Beginner's Guide for WordPress / Start your WordPress Blog in minutes

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

Do you want to add a cookies consent popup in WordPress?

Your WordPress site may be setting cookies on your visitors’ browsers, and the European Union’s cookie law requires websites to get user consent before setting any cookies on their computers.

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

How to add cookies consent popup in WordPress

Why Are Cookie Popups Necessary?

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

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

Apart from these, WordPress plugins can also set their own cookies to store different information or recognize repeat visitors.

You can learn how your site uses cookies by checking our guide on how to know if your WordPress website uses cookies.

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

That’s why in Europe and a few other countries, website owners are required to let users know about their usage of cookies. If your website targets audiences in those regions, then you need to show a cookie consent disclaimer.

You Need to Show a Cookie Consent Disclaimer

The easiest way to do that is with a WordPress GDPR plugin. Cookie Notice and Cookiebot are two of the most popular cookie notification plugins and are compatible with many other popular WordPress plugins.

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

Method 1: Add a Cookie Popup with Cookie Notice

First, install and activate the Cookie Notice plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

On activation, Cookie Notice will run a compliance check and offer you some premium services. We’ll only use the plugin to display a cookie notification, so you just need to scroll down and click the ‘Skip for now’ link.

The plugin will start to display a basic cookies popup to your visitors right away without any additional configuration. The default message is suitable for most websites.

Cookie Notice Default Notification

If you’d like to customize the notification, then you need to visit the Cookies section of your dashboard

Then scroll down to Notice Settings section.

Cookie Notice Customize Message

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 haven’t already created one, then you can follow our guide on how to create a privacy policy page in WordPress.

After that, you can select that page from the Privacy Policy dropdown menu.

Cookie Notice Privacy Policy

You can also give your visitors the option of refusing and revoking consent.

To do that, just click on the ‘Refuse consent’ and ‘Revoke consent’ checkboxes. The default settings will work for most websites.

Cookie Notice Consent Options

If you scroll down to the Notice Design section, then you can choose the position, animation, button style, and colors of your cookie consent popup.

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

Cookie Notice's Notice Design Section

Once you’re finished, click on the ‘Save Changes’ button to store your settings.

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

Customized Cookie Notice Notification

Method 2: Add a Cookie Popup with Cookiebot

Cookiebot is another popular cookie plugin. While it’s not as easy to set up as Cookie Notice and won’t work unless you sign up for a free Cookiebot account, it does offer some additional customization options.

First, install and activate the Cookiebot plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Once activated, a new Cookiebot section is added to your WordPress dashboard. You’ll need to navigate to Cookiebot » Settings in your WordPress dashboard to configure the plugin.

If you don’t already have a Cookiebot ID, then you’ll need to sign up for one using the ‘Sign up for free on’ link. Once you’ve received your ID number by email, you need to paste it into the Cookiebot ID text field.

Cookiebot ID

You might like to check ‘Auto-update Cookiebot’ in the Advanced settings section.

This way, the plugin stays up to date with any changes in GDPR legislation.

Auto-update Cookiebot

For testing purposes, you should also check ‘This checkbox will enable Cookiebot on front end while you’re logged in’.

If you leave it unchecked, then you won’t see the popup when you’re logged into your WordPress site.

Enable Cookiebot While Logged In

After you’re done with the settings, don’t forget to click the ‘Save Changes’ button at the bottom.

Another setting to consider is the CCPA configuration for visitors from California. You can enable this from the Cookiebot » Legislations page. All you need to do is check the box and then click the Save Changes button.

Cookiebot CCPA Configuration

We’re not finished yet, but we’re getting close. To finish configuring Cookiebot, we now need to return to the Cookiebot website and log in.

First, you should add your website’s domain name to Cookiebot’s domain group. With the free version, only one domain is supported.

Cookiebot Domain Group

Once you click the Save button, your visitors will now see the default cookies popup when visiting your website.

This will let them know that your website uses cookies, and will let them consent to receiving some or all of them or denying them. It will also explain the choices so they can make an informed decision.

Cookiebot Default Notification

Next, you’ll need to navigate to the Dialog tab from the Cookiebot website.

Here you can choose the location and appearance of the popup.

Cookiebot Dialog Tab

You can change these defaults to anything you like. We chose a different template, then changed the position to Bottom, type to Accept/Decline, and method to Explicit Consent.

You’ll be able to see the changes by clicking the Preview button or returning to your website.

Cookiebot Customized Notification

If you notice that the wording used in the popup doesn’t match the reasons your website uses cookies, then you can change it.

You’ll find the settings to do this by navigating to the Content tab on the Cookiebot website.

Cookiebot's Content Page

You might also want to add a cookie declaration to your website’s privacy policy. If you haven’t already created a privacy policy page, then you can follow our guide on how to create a privacy policy page in WordPress.

You need to start by navigating to the Content tab on Cookiebot’s website. By default, the cookie declaration uses Cookiebot’s default wording.

Cookiebot's Cookie Declaration Page

If you need to customize the message because your website uses cookies for a different reason, then you need a premium Cookiebot subscription.

Alternatively, you can just type your own declaration into your privacy policy, but you’d miss out on features such as links where visitors can change or withdraw their consent.

In this tutorial, we’ll add the default declaration to our privacy policy. You just need to edit your privacy policy and insert the shortcode [cookie_declaration] where you want to display the cookie declaration.

Cookiebot Cookie Declaration Shortcode

To see the declaration you need to save and preview the page.

This is how the first few paragraphs look on our test website.

Cookie Declaration Preview

Bonus: Improve GDPR Compliance with MonsterInsights

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

That’s because MonsterInsights offers an EU Compliance addon that works out of the box. It will automatically change your analytics settings to help you stay in compliance with privacy laws.

MonsterInsights EU Compliance Addon

MonsterInsights is a premium plugin, and EU compliance is included in the lowest plan. The best thing is that it automatically integrates with both 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 using MonsterInsights.

Once MonsterInsights is installed and set up, you’ll need to install and activate the EU Compliance addon.

You can do that by navigating to the Insights » Settings page in your WordPress dashboard. After that, you need to click on the Engagement tab and scroll down to EU Compliance.

MonsterInsights Install and Activate EU Compliance Addon

Once you click on the ‘install and activate’ link you will see a list of all MonsterInsights addons.

You need to find the EU Compliance addon and click on the Install button.

Install the MonsterInsights EU Compliance Addon

The addon will be automatically activated.

You can check this by returning to the MonsterInsights settings page. When you look at the EU Compliance section, you will see that the addon has been turned on.

MonsterInsight's EU Compliance Configuration

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

For instance, you can see that it automatically anonymized IP addresses in Google Analytics, disabled demographics, and interest reports, disabled UserID tracking, and much more.

MonsterInsight's EU Compliance Configuration Details

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

MonsterInsights will automatically make changes to the Google Analytics tracking code if any of the plugins are installed on your site. This way, it will wait for consent before tracking users in Google Analytics.

EU compliance with plugins

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

You may also want to see our step by step guide on how to properly move your WordPress site from HTTP to HTTPS, or check out our comparison of the best business phone services for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

23 CommentsLeave a Reply

  1. Thank you for the article. Does this plugin give the option for people to accept or decline?

    • It does not as that would require it to interact with everything that sets a cookie and have the power to disable it which isn’t something a plugin would have easily.


  2. This article was very helpful but I wonder if it’s a little out of date.

    The plugin that you recommended, GDPR Cookie Consent Banner, has not been tested for the latest version of WP and apparently hasn’t been updated in 11 months.

    Are you planning an update to this article?

  3. How do I make sure my website does not drop cookies into a visitor’s computer? I do not need to do this.

    • It would depend on what tools and plugins you are using on your site, you would want to reach out to those to see if they add any cookies or not.


  4. We can ALWAYS count on WPBeginner to give us solid plugin recommendations. I’ve been a “beginner” for over a decade haha!

  5. Hi,
    Thanks for sharing this useful post. However, many plugins make site loads slower. Can you please suggest some code to display this notification.

  6. Can you recommend a way to add a cookie consent without the use of a plugin? My site has too many plugins already.

  7. Hi,
    I’m trying to set up an e-commerce website and have to comply with EU law regarding the use of cookies. How can I find out which cookies my website is using?

  8. Hi,

    I’m looking for a pop up box that imitates the one on the gucci website as it is a square, do you know of any?

  9. hi me kulbir singh

    something problem in my website ,,,,,when i open to this ,,it is automatically redirect on another multi pal site ,,,,when i open second time it is working properly

    and if when i clear cache cookies of browser (problem in all browser) ,then i go to ,,,same problem display on system

    please visit on my website ,,,and please tell me ,,,, what is solution of this problem

    is this problem of cookies or not ,,,,

  10. Thank you wpbeginner. I was looking for something exactly like this. Light weight plugin with a simple notification for the cookie policy.

  11. Thanks the post, the plugin works perfectly on all of my websites including link to the policy page.

  12. It has a glitch. The link to the policy page goes to an error page. I double-checked my spelling and looked on their support forum. There I saw that others left the same request for a fix. No response from developer. This plugin still works for me, but without the link.

    • @Eva thank you for notifying us, we have tried to contact plugin author as well. It seems like the plugin author didn’t mean to add this functionality. Currently the plugin is only good for adding a simple notification without a link, which satisfies the requirement for the cookie law in most EU countries. However, there should be a link so that users can read privacy policy.


Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.