According to Mozilla’s Developer Network’s definition, an HTTP Cookie is a is a small piece of data that a server sends to the user's web browser. The browser may store that data on the user’s computer and send it back the next time this user visits the same website.
Cookies are mainly used for the following purposes:
When it comes to displaying cookie consent in WordPress, there is no shortage of plugins. Below, I’ll briefly go over the top four cookie consent plugins for WordPress and then show you how to use one of them on your WordPress website.
The EU Cookie Law plugin is another popular plugin with more than 100,000 active installs and 4,5-star rating. This plugin has slightly more options than the previous plugin and gives you the option to inform users that your site has cookies, with a popup for more information, and option to lock scripts before acceptance. The benefit of this plugin is that you can easily insert the cookie consent onto any page or post through the shortcode.
The GDPR Cookie Consent plugin is a robust plugin that offers a plethora of options when it comes to displaying cookie consent notices. Not only can you customize the text and where the notice will appear but you can also customize how the cookie consent looks like, as well as set styles for the accept and reject buttons, and more. The GDPR Cookie Consent plugin also comes with the ability to create a list of cookies and store information about non-necessary cookies.
For the purposes of this tutorial, we’ll be using the GDPR Cookie Consent plugin as it offers the most options out of the four.
Here’s how to use the plugin:
As with anything WordPress related, there is a way to add a cookie consent notice to your WordPress website without using a plugin. This step will require copying and pasting a code snippet into your header.php file. Here’s how to do it.
Start by navigating to Cookie Consent’s website. This is a free and open-source solution for displaying cookie consent on your website that can be customized not only in terms of how it looks on your site but also in terms of consent type.
Click on the download button. You will be taken to a new page where you can choose where the cookie consent should appear, how it looks, and which consent type you want to use. You can choose from a simple cookie notification or from a more advanced notification that allows visitors to accept or disable the cookies. For the purposes of this tutorial, I’ve chosen a simple cookie notification but you can choose your preferred consent type.
When you’re done generating and customizing your cookie consent, copy the provided code. Go back to your WordPress dashboard and navigate to Appearance > Editor and open up your header.php file. Paste the generated code there, save the changes, and close the editor.
Alternatively, you can use a plugin like Head and Footer Scripts Inserter to insert the script into your website without having to touch the theme files.
All that’s left to do now is to visit your website and make sure the cookie consent notice displays properly.
Adding a cookie consent notice helps you stay compliant with the laws and informs your users on which data you’re collecting and how you use it. Use this tutorial to add cookie consent to your WordPress website with or without the help of plugins.
I have tons of great free content and giveaways! Join 10,000+ others and get access to coupons, freebies, and other great wordpress tips and tricksfor your wordpress website!