How do I add cookie notifications to WordPress? I show you how to copy HTML code into your WordPress site. You do not need to know how to code. Once finished, your website will be EU cookie law compliant.
If you have visitors to your website from any EU country, your website must be EU cookie law compliant.
My how to guide will have your website compliant in minutes.
Let’s get started.
- EU member countries list
- The cookie consent code
- How to put the code into your WordPress site
- How to check if your cookie notification is working
- Changing the look of your cookie consent notice
EU member countries list
If you get visitors to your website from any of the following countries, you need a cookie consent notice on your site.
The cookie consent code
To get started, we need the code for our cookie notification. To get this, we head over to www.cookieconsent.osano.com, here is the homepage.
Next, click on the green ‘Download’ link. Now we have this.
The code you need is on the right, first, we configure our cookie consent display.
Use the drop down menu boxes on the left, to get your cookie consent display the way you want.
The black consent display that you see at the bottom of the above screenshot, is how it will look with the current settings. As you change the configuration, the display will change to match those changes.
The configure options allow you to change the position of the display, the layout, and the colours.
There is an option to change compliance type, I would recommend going with the default setting, then you don’t need to add extra code.
Finally, if you want to change the default text, you can type a different message.
How to put the code into your WordPress site
I have a website that I use to do tutorials. This is the homepage.
I don’t have a cookie consent notice on this site yet, I will correct that now.
Keep the website with your code open, we will come back to that in a minute.
Let’s go to our WordPress admin page. Here is mine.
Installing the headers and footers plugin
The easiest way to input the cookie code is by using a WordPress plugin called ‘Headers and footers’.
I will install that plugin next. To do that I find ‘Plugins’ on the left, on the popup menu, I select ‘add new.’
After I select ‘Add New’, I come to the WordPress plugin library. To find the plugin, I type ‘Headers and footers’ into the search bar, like this.
The plugin I need, is on the top-left. To install, click on the ‘Install now’ link. After a few seconds, the same link will change to ‘Activate’. Click on it once more, then you can start using the plugin.
This plugin is found in the left menu, under ‘Settings.’ Click on the ‘Headers and footers’ link.
After I click on the link, I come to this.
As you can see from the above screenshot, I have two boxes. One is for code that needs to be in the ‘head’ section, the other box is for code that needs to be in the ‘body’ section.
Let’s go back to the website with our cookie code, and check what code needs to go in each box.
The website tells us which section to put the code in. We have two sets of code that we use to activate our cookie notification. The top code goes into the ‘head’ section box, and the other code goes into the ‘body’ section box.
I have just done that, here is my WordPress admin.
To activate the cookie notification on my website, I click on ‘Save.’
How to check if your cookie notification is working
To check if my cookie notification is working, I go to any page on my website, and the notification should display along the bottom of the screen.
There is my cookie consent notice along the bottom of my site.
Changing the look of your cookie consent notice
If you decide you want to change the configuration of your notification, go back to the cookie consent website, make your changes, and copy the new code.
Use the headers and footers plugin to input the code into your site, and save.
It is easy to generate a cookie consent notification for your WordPress site. Don’t get caught out. The process takes a few minutes.
Go to cookieconsent.osano.com and configure your notice. Go back to your WordPress admin, install the ‘Headers and Footers’ plugin. Paste your code into the correct boxes, and your website is compliant.
It could not be easier.
Another notification service I like to use to promote new posts, is www.subscribers.com. Every time I publish a new post, I send a push notification to all my subscribers.
If you would like to learn about this service, check out my ‘How do I add push notifications to my WordPress site?‘ post.
What service do you use to make your site cookie consent compliant?
Did you know you need to make your site compliant if you have visitors to your site from EU counties?
If you would like to ask anything, please leave your question in the comments box.
I look forward to reading your comments.