{"id":649,"date":"2016-09-29T00:00:00","date_gmt":"2016-09-29T00:00:00","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/wordpresshow-to-display-cookie-notice-in-wordpress-without-any-plugins\/"},"modified":"2025-01-31T08:07:52","modified_gmt":"2025-01-31T08:07:52","slug":"how-to-display-wordpress-cookie-notice","status":"publish","type":"post","link":"\/my\/tutorials\/how-to-display-wordpress-cookie-notice","title":{"rendered":"WordPress Cookie Notice: How to Display It Without Plugins"},"content":{"rendered":"<p>In this article, we will show you how to display the cookie notice on a WordPress website without using any plugins. Let&rsquo;s check it out!<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Mega-WordPress-Cheat-EN.pdf\" target=\"_blank\" rel=\"noopener\">Download all in one WordPress cheat sheet<\/a><\/p><p>\n\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-why-do-we-need-a-cookie-notice\">Why Do We Need a Cookie Notice<\/h2><p>Since cookies collect users&rsquo; 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&rsquo;s a European Union directive that demands that any website gets consent from their visitors about the use of their data.<\/p><p>It doesn&rsquo;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.<\/p><p>Besides, adding a cookie notice for your WordPress website doesn&rsquo;t cost a dime and is easy to implement! It&rsquo;s also an important aspect of complying with <a href=\"\/my\/tutorials\/complete-wordpress-gdpr-guide\/\">WordPress GDPR<\/a>.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/my\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner-1024x300.png\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner-1024x300.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner-300x88.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner-150x44.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner-768x225.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner-1536x450.png 1536w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2024\/06\/New-WP_in-text-banner.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-how-to-display-wordpress-cookie-notice-without-a-plugin\">How to Display WordPress Cookie Notice Without a Plugin<\/h2><p>Adding unnecessary plugins to your WordPress site may slow down. So, it&rsquo;d be wise to limit plugin installations and tweaking everything manually, if possible.<\/p><p>To display WordPress cookie notice, follow these simple steps:<\/p><ol class=\"wp-block-list\">\n<li>Generate cookie notice code by visiting <a href=\"https:\/\/www.websitepolicies.com\/create\/cookie-consent-banner\" target=\"_blank\" rel=\"noopener\">WebsitePolicies<\/a>.<\/li>\n\n\n\n<li>Head to <strong>Configuration wizard<\/strong> section and personalize a cookie notice template by adjusting its position, layout, color, and its custom text.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\"><img decoding=\"async\" width=\"1143\" height=\"612\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\" alt=\"Adjusting a WordPress cookie notice template in WebsitePolicies\" class=\"wp-image-19756\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-template-adjuster.png 1143w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-template-adjuster-150x80.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-template-adjuster-300x161.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-template-adjuster-768x411.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-template-adjuster-1024x548.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-template-adjuster-990x530.png 990w\" sizes=\"(max-width: 1143px) 100vw, 1143px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>You can preview the template you&rsquo;re creating using the <strong>Click to preview<\/strong> option.<\/li>\n\n\n\n<li>Once you&rsquo;re done, press <strong>Copy code<\/strong>.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\"><img decoding=\"async\" width=\"1133\" height=\"324\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\" alt=\"Copying the WordPress cookie notice code in WebsitePolicies\" class=\"wp-image-19757\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-code-generator-website.png 1133w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-code-generator-website-150x43.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-code-generator-website-300x86.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-code-generator-website-768x220.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-code-generator-website-1024x293.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/cookie-notice-code-generator-website-990x283.png 990w\" sizes=\"(max-width: 1133px) 100vw, 1133px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"5\">\n<li>Log in to your <a href=\"\/my\/tutorials\/wordpress\/how-to-login-to-wordpress-dashboard\">WordPress dashboard<\/a> and navigate to<strong> Appearance -&gt; <a href=\"\/my\/tutorials\/wordpress-theme-editor\/\">Theme Editor<\/a><\/strong>.<\/li>\n\n\n\n<li>Locate header.php file under <strong>Theme Files<\/strong>.<\/li>\n\n\n\n<li>Open the file and paste the code under the <strong>&lt;head&gt;<\/strong> tag.<\/li>\n<\/ol><div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1163\" height=\"462\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\" alt=\"Pasting WordPress cookie notice code to header.php file\" class=\"wp-image-19758\" srcset=\"https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/header-php-file-on-wordpress.png 1163w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/header-php-file-on-wordpress-150x60.png 150w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/header-php-file-on-wordpress-300x119.png 300w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/header-php-file-on-wordpress-768x305.png 768w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/header-php-file-on-wordpress-1024x407.png 1024w, https:\/\/www.hostinger.com\/my\/tutorials\/wp-content\/uploads\/sites\/45\/2016\/09\/header-php-file-on-wordpress-990x393.png 990w\" sizes=\"(max-width: 1163px) 100vw, 1163px\" \/><\/figure><\/div><ol class=\"wp-block-list\" start=\"8\">\n<li>Click on <strong>Update File<\/strong> to save your changes.<\/li>\n<\/ol><p>If you want to check if your settings are live, simply visit your website. Make sure your cookie notice is showing and works properly.<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>The cookie generator website will ask you to link your own cookie or privacy policy. If you don&rsquo;t have one already, you can <a href=\"https:\/\/www.websitepolicies.com\/cookie-policy-generator\" target=\"_blank\" rel=\"noopener\">generate<\/a> it for free.<\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>There you have it! Your website now complies with the EU Cookie Laws, and you&rsquo;ve learned how to display WordPress Cookie Notice by merely pasting the generated code. Here&rsquo;s a quick recap:<\/p><ol class=\"wp-block-list\">\n<li>Generate a free cookie notice code from WebsitePolicies.<\/li>\n\n\n\n<li>Copy-paste the code to your <strong>header.php<\/strong> file on WordPress.<\/li>\n<\/ol><p>That was pretty easy, right? Good luck!<\/p><p>\n\n\n<div class=\"protip\">\n                    <h4 class=\"title\">Learn Other Advanced WordPress Techniques<\/h4>\n                    <p><a href=\"\/my\/tutorials\/wordpress-pagination\">WordPress Pagination Guide<\/a><br>\n<a href=\"\/my\/tutorials\/wordpress-privacy-policy\">How to Add a WordPress Privacy Policy Page<\/a><br>\n<a href=\"\/my\/tutorials\/wordpress-lazy-load\">Guide to Lazy Loading on WordPress<\/a><br>\n<a href=\"\/my\/tutorials\/wordpress-excerpt-length\/\">WordPress Excerpt Length: What It Is, How to Change It + Plugin Recommendations<\/a><br>\n<a href=\"\/my\/tutorials\/wordpress-a-b-testing\">A\/B Testing With WordPress: Best Practices and Tools to Optimize Conversion<\/a><br>\n<a href=\"\/my\/tutorials\/how-to-hide-page-title-wordpress\">How to Hide Page Title in WordPress<\/a><\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will show you how to display the cookie notice on a WordPress website without using any plugins. Let&rsquo;s check it out! Why Do We Need a Cookie Notice Since cookies collect users&rsquo; information and store them for a certain period of time, disclosing the use of cookies on your website is [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/my\/tutorials\/how-to-display-wordpress-cookie-notice\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Display WordPress Cookie Notice Without any Plugins","rank_math_description":"Want to learn how to display WordPress cookie notice for your website? Want to avoid using plugins? Check out our simple guide to learn how!","rank_math_focus_keyword":"wordpress cookie notice","footnotes":""},"categories":[22634,22632],"tags":[],"class_list":["post-649","post","type-post","status-publish","format-standard","hentry","category-website-management","category-wordpress"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-display-wordpress-cookie-notice","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-display-wordpress-cookie-notice","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-display-wordpress-cookie-notice","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-display-wordpress-cookie-notice","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-display-wordpress-cookie-notice","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-display-wordpress-cookie-notice","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-display-wordpress-cookie-notice","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-display-wordpress-cookie-notice","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":20,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/649\/revisions"}],"predecessor-version":[{"id":105058,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/posts\/649\/revisions\/105058"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/categories?post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/my\/tutorials\/wp-json\/wp\/v2\/tags?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}