Don’t miss the New Year’s Sale deals!
search
In this article

WordPress cookie notice: how to display it without plugins

In this article, we will show you how to display the cookie notice on a WordPress website without using any plugins. Let’s check it out!

Download all-in-one WordPress cheat sheet

Since cookies collect users’ information and store them for a certain period of time, disclosing the use of cookies on your website is required by the EU Cookie Law. It’s a European Union directive that demands that any website gets consent from their visitors about the use of their data.

It doesn’t matter whether your website is based in Europe, chances are that EU visitors are still visiting it, therefore becoming a subject to the EU Cookie Laws.

Besides, adding a cookie notice for your WordPress website doesn’t cost a dime and is easy to implement! It’s also an important aspect of complying with WordPress GDPR.

Adding unnecessary plugins to your WordPress site may slow down. So, it’d be wise to limit plugin installations and tweaking everything manually, if possible.

To display WordPress cookie notice, follow these simple steps:

  1. Generate cookie notice code by visiting WebsitePolicies.
  2. Head to Configuration wizard section and personalize a cookie notice template by adjusting its position, layout, color, and its custom text.
Adjusting a WordPress cookie notice template in WebsitePolicies
  1. You can preview the template you’re creating using the Click to preview option.
  2. Once you’re done, press Copy code.
Copying the WordPress cookie notice code in WebsitePolicies
  1. Log in to your WordPress dashboard and navigate to Appearance -> Theme Editor.
  2. Locate header.php file under Theme Files.
  3. Open the file and paste the code under the <head> tag.
Pasting WordPress cookie notice code to header.php file
  1. Click on Update File to save your changes.

If you want to check if your settings are live, simply visit your website. Make sure your cookie notice is showing and works properly.

Pro Tip

The cookie generator website will ask you to link your own cookie or privacy policy. If you don’t have one already, you can generate it for free.

Conclusion

There you have it! Your website now complies with the EU Cookie Laws, and you’ve learned how to display WordPress Cookie Notice by merely pasting the generated code. Here’s a quick recap:

  1. Generate a free cookie notice code from WebsitePolicies.
  2. Copy-paste the code to your header.php file on WordPress.

That was pretty easy, right? Good luck!

Author
The author

Domantas G.

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.

What our customers say

Comments

Author
Mike V Among Lions

March 15 2019

This is fantastic. Thank you very much guys! Great work!!!

Author
Juan Jesús

August 02 2019

Hello! I saw a lot of services talking about a cookie consent management system, is it neccesary ?

Author
Lilia

October 03 2019

Thank you very much for this great article, Gediminas! Worked perfectly on my website! I have tons of plugins installed already, so I was happy to find a workaround without another plugin. Thanks again!

Author
Colin Wilson

November 18 2019

Brilliant! Saved me a lot of time and heartache. Probably better safe than sorry.

Author
Ross

February 24 2020

Very simple, looks great (picked my brand colours) and done in under 30 minutes. Thank you!

Author
Antoine Clinton

September 04 2020

This is so convenient and cool, but for some reason, can't get mine to show and I'm positive I placed the code in the right place. Would love to get this setup and any help would be most appreciated! Thanks...

Author
rafael stone

December 10 2020

hey there i have a question. my site is on PHP and its blog is on Wordpress. i have applies cookie consent script on both but it is only appearing on PHP not on Wordpress blog. kindly help me in this matter thanks

Author
frank lewis

April 19 2022

i was searching for this information and here i found similar to this. It's very helpful and informative.

Leave a reply

Please fill the required fields.Please accept the privacy checkbox.Please fill the required fields and accept the privacy checkbox.

Thank you! Your comment has been successfully submitted. It will be approved within the next 24 hours.