---
title: "How to Create a Cookie Notice with Nelio Popups"
description: "If you want to create a customized cookie notice that matches your website design, you can easily do so with Nelio Popups. Check out these examples!"
url: https://neliosoftware.com/blog/how-to-create-a-cookie-notice-with-nelio-popups/
date: 2022-08-18
modified: 2022-08-04
author: "Ruth Raventós"
image: https://neliosoftware.com/wp-content/uploads/2022/08/kai-pilger-1k3vsv7iIIc-unsplash.jpg
categories: ["WordPress"]
tags: ["Plugins", "Tutorials", "WordPress Essentials"]
type: post
lang: en
---

# How to Create a Cookie Notice with Nelio Popups

If you are reading this post, you’ve probably seen the following popup notice on our website at some point in the past, where we ask you to accept our cookie policy to continue reading:

![Screenshot of Nelio's cookie dialog](https://neliosoftware.com/wp-content/uploads/2020/09/cookie-popup-window.png)![Screenshot of Nelio's cookie dialog](https://neliosoftware.com/wp-content/uploads/2020/09/cookie-popup-window.png)*Screenshot of Nelio’s cookie notice.*

If I’m honest, we’re not very kind of this UX when you first arrive at our website, but [we need it](https://neliosoftware.com/blog/put-the-mask-on-your-website/) to comply with the [*Guide on the use of cookies*](https://www.aepd.es/es/documento/guia-cookies.pdf) so that we can adapt our web to the new guidelines of the European Committee for Data Protection published [by the AEPD](https://www.aepd.es/es/prensa-y-comunicacion/notas-de-prensa/aepd-actualiza-guia-cookies) in July 2020.

In this post I will first share how we can create a cookie notice like the one above on our website easily with [Nelio Popups](https://neliosoftware.com/popups/). Then we will see other examples of cookie notice designs you can also create with it.

## Create a Cookie Notice with Nelio Popups

Click on “Add New” in the Nelio Popups menu to create a new popup. Using the well-known block editor, you can add the content you want in your popup:

![Creating a cookie notice with the Nelio Popups editor](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/nelio-cookies-consent-with-nelio-popups.jpg)![Creating a cookie notice with the Nelio Popups editor](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/nelio-cookies-consent-with-nelio-popups.jpg)*Viewing the blocks that make up a cookie notice with Nelio Popups.*

### Specify the Properties of the Popup

From the sidebar of the Nelio Popups editor you can specify additional popup properties such as its size, position, margins, or padding. You can also indicate if you want it to be shown with some kind of animation or, as in this case, to add an overlay behind the popup while it is displayed.

To display the cookie notice to all your visitors on all pages, you must also indicate that it should be “shown everywhere” during the “page view” trigger.

![The popup will show on any page](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/04/select-where-popup-can-show-up.png)![The popup will show on any page](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/04/select-where-popup-can-show-up.png)*The popup will be displayed on any page.*

![The popup will be displayed when visiting the page](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/04/select-the-trigger-open-popup.png)![The popup will be displayed when visiting the page](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/04/select-the-trigger-open-popup.png)*The popup will be displayed when visiting the page.*

Also, being strict with the RGPD, you should make sure your visitors accept the cookies before browsing your website. To do so, disable the “close on ESC” and “close on outside click” checkboxes, and enable “Lock body scroll:”

![Additional cookie notice settings](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/additional-settings-cookie-notice.png)![Additional cookie notice settings](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/additional-settings-cookie-notice.png)*Additional cookie notice settings.*

### Add the Cookie Creation Code

Once the content of the popup is created, we must add the functionality to the “Accept and continue” button so that a consent cookie is generated when the user clicks on it. First, in the button’s advanced properties, set a unique HTML anchor to identify it:

![HTML anchor of the cookie acceptance button](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/html-anchor-cookie-consent-button.png)![HTML anchor of the cookie acceptance button](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/html-anchor-cookie-consent-button.png)*HTML anchor of the cookie acceptance button.*

Then, below the button, create a new HTML block with the following code:

```
<script>
document.getElementById( 'cookie-consent-button' )?.addEventListener( 'click', () => {
  COOKIE_NAME = 'cookieConsentAccepted';

  date = new Date();
  date.setFullYear( date.getFullYear() + 1 );
  document.cookie = `${ COOKIE_NAME }=true; expires=${ date.toUTCString() }; path=/`;

  window.parent.location.reload();
} );
</script>Code language: HTML, XML (xml)
```

The previous snippet adds a click listener to our `cookie-consent-button` button. When the button is clicked, it creates a cookie names “cookieConsentAccepted” that expires in one year and then reloads the current page.

Here’s how it should look like:

![Edition of the cookie popup with the HTML code included](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-cookies-popup.jpg)![Edition of the cookie popup with the HTML code included](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-cookies-popup.jpg)*Edition of the cookie popup with the HTML code included.*

### Display the Cookie Notice Only When Consent Has Not Been Accepted

Finally, all we have to do is prevent the popup from showing up when the cookie we just created exists. We can achieve this by adding a new condition in our popup: “show the popup if if said cookie does **not** exists.”

![Shows the cookie notice only if the cookie acceptance cookie does not exist](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/show-popup-condition-if-cookies-does-not-exists.png)![Shows the cookie notice only if the cookie acceptance cookie does not exist](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/show-popup-condition-if-cookies-does-not-exists.png)*Shows the cookie notice only if the cookie acceptance cookie does not exist.*

And that’s it! We have already created the cookie notice with Nelio Popups. You can try this out by looking at the cookies in your browser. Just inspect the current page, click on the button, and then look for the cookie named “cookieConsentAccepted.” Its value should be `true`:

![Screenshot of page cookie inspection](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/inspect-cookies.png)![Screenshot of page cookie inspection](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/inspect-cookies.png)*Screenshot of the cookie inspection of the page.*

## Examples of Cookie Notices

Nelio Popups makes it super easy to create alternative popup notices, with custom layouts and display options. We have already seen that the notice on our website is a well visible popup in the center of the page and does not allow the user to continue browsing the web until the visitor gives us their consent.

![](https://neliosoftware.com/wp-content/plugins/nelio-addons/partials/blog-ads/popups/assets/background.jpg)![](https://neliosoftware.com/wp-content/plugins/nelio-addons/partials/blog-ads/popups/assets/background.jpg)

## Nelio Popups

Fantastic plugin! It’s really easy to create popups as you’re already used to the editor, and all the options it has are really well crafted.

![](https://neliosoftware.com/wp-content/plugins/nelio-addons/partials/blog-ads/popups/assets/juan.jpg)![](https://neliosoftware.com/wp-content/plugins/nelio-addons/partials/blog-ads/popups/assets/juan.jpg)

Juan Hernando

[WordPress.org](https://wordpress.org/support/topic/awesome-plugin-for-popups-2/)

[Free Download](https://wordpress.org/plugins/nelio-popups/)

[Premium Version](https://neliosoftware.com/popups/#premium)

### Box with two buttons

If you have a page where the user can select the various cookie administration options, you can add to your cookie notice an additional button that links to that page:

![Cookie box popup edition 1](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-cookie-box1-popup-example.png)![Cookie box popup edition 1](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-cookie-box1-popup-example.png)

![Preview of Cookies Notice Box 1](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/cookie-box1-popup-example.png)![Preview of Cookies Notice Box 1](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/cookie-box1-popup-example.png)

*Editing and previewing a cookie notice with two buttons displayed in the middle of the page.*

As you can see on the image above, the notice is made up of the following blocks: a header, a paragraph, a separator line and the two buttons.

If you’re not subject to the GDPR and you want to give the option to close the cookie notice and let the user to continue browsing, you can add the option to close the cookie notice with an additional button or a cross. In such a case, you probably prefer to display the notice in a corner of the page so that it is not so invasive.

![Edition of the Box 2 cookie notice with Nelio Popups](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-cookies-box-2-example.png)![Edition of the Box 2 cookie notice with Nelio Popups](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-cookies-box-2-example.png)

![Preview example of cookie notice with two buttons](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/cookies-box-example-nelio-popups.png)![Preview example of cookie notice with two buttons](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/cookies-box-example-nelio-popups.png)

*Editing and previewing a cookie notice with two buttons displayed in the bottom right corner of the page.*

### Banners at the Top of the Page

You will find more than one website that prefers to display the cookie notice as a banner at the top of the page. The advantage of this option is that, although the user cannot continue browsing the site unless they give their consent, you allow them to see more page’s content and it’s less intrusive.

![Example edition of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-top-header-1-cookie-example.png)![Example edition of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-top-header-1-cookie-example.png)

![Example preview of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/top-header-1-copkies-example.jpg)![Example preview of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/top-header-1-copkies-example.jpg)

*Editing and previewing a cookie notice displayed as a banner at the top of the page.*

The banner can be the full width of the page and include more buttons or a link to additional information.

![Example edition of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-top-header-2-cookies-example.png)![Example edition of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-top-header-2-cookies-example.png)

![Example preview of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/top-header-2-cookies-example.png)![Example preview of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/top-header-2-cookies-example.png)

*Editing and previewing a cookie notice displayed as a banner that includes two buttons and a link..*

To make the banner stand out more, you can add a border in a more prominent color.

![Example edition of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-top-header-3-cookie-example.png)![Example edition of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-top-header-3-cookie-example.png)*Example edition of a cookie notice banner.*

![Example preview of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/top-header-3-cookie-example.png)![Example preview of a cookie notice banner](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/top-header-3-cookie-example.png)*Example preview of a cookie notice banner.*

*Editing and previewing a cookie notice displayed as a banner with a colored border.*

### Footer at the Bottom of the Page

Alternatively, the least intrusive cookie notices are those displayed at the bottom of the page. In this way, the first thing the user sees is the content and then the notice. Below you can see three different examples of cookie notices displayed at the bottom of the page with a background color to make them stand out.

![Example edition of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-fixed-footer-1-cookies-example.png)![Example edition of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-fixed-footer-1-cookies-example.png)*Example edition of a cookie notice footer.*

![Example preview of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/footer-1-cookie-example.png)![Example preview of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/footer-1-cookie-example.png)*Example preview of a cookie notice footer.*

*Editing and previewing a cookie notice with three buttons displayed at the bottom of the page.*

![Example edition of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-footer-2-cookies-example.png)![Example edition of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-footer-2-cookies-example.png)

![Example preview of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/footer-2-cookie-example.png)![Example preview of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/footer-2-cookie-example.png)

*Editing and previewing a cookie notice displayed at the bottom of the page that includes a button and a link to view additional information.*

![Example edition of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-footer-3-cookies-example.png)![Example edition of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/editing-footer-3-cookies-example.png)*Example edition of a cookie notice footer.*

![Example preview of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/footer-3-cookie-example.png)![Example preview of a cookie notice footer](https://neliosoftware.com/es/wp-content/uploads/sites/3/2022/08/footer-3-cookie-example.png)*Example preview of a cookie notice footer.*

*Editing and previewing a cookie notice displayed at the bottom of the page with two buttons.*

## Conclusion

If your website has visitors from a European country, make sure that they accept your use of cookies. With [Nelio Popups](https://neliosoftware.com/popups/) you can create cookie notices easily that are perfectly integrated with your website and with the flexibility to display them wherever you want.

*Featured image of [Kai Pilger](https://unsplash.com/@kaip?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/warning?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText).*
