{"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":"2026-03-09T19:20:14","modified_gmt":"2026-03-09T19:20:14","slug":"how-to-display-wordpress-cookie-notice","status":"publish","type":"post","link":"\/ng\/tutorials\/how-to-display-wordpress-cookie-notice","title":{"rendered":"WordPress cookie notice: how to display it without plugins"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><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\">Download all-in-one WordPress cheat sheet<\/a><\/p><p>\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=\"\/ng\/tutorials\/complete-wordpress-gdpr-guide\/\">WordPress GDPR<\/a>.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/ng\/wordpress-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"2048\" height=\"600\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/public\" alt=\"\" class=\"wp-image-111781\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=2048,fit=scale-down 2048w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2024\/06\/New-WP_in-text-banner.png\/w=1536,fit=scale-down 1536w\" sizes=\"auto, (max-width: 2048px) 100vw, 2048px\" \/><\/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\">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\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1143\" height=\"612\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\/public\" alt=\"Adjusting a WordPress cookie notice template in WebsitePolicies\" class=\"wp-image-19756\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\/w=1143,fit=scale-down 1143w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-template-adjuster.png\/w=990,fit=scale-down 990w\" sizes=\"auto, (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\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1133\" height=\"324\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\/public\" alt=\"Copying the WordPress cookie notice code in WebsitePolicies\" class=\"wp-image-19757\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\/w=1133,fit=scale-down 1133w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/cookie-notice-code-generator-website.png\/w=990,fit=scale-down 990w\" sizes=\"auto, (max-width: 1133px) 100vw, 1133px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"5\">\n<li>Log in to your <a href=\"\/ng\/tutorials\/wordpress\/how-to-login-to-wordpress-dashboard\">WordPress dashboard<\/a> and navigate to<strong> Appearance -&gt; <a href=\"\/ng\/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\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1163\" height=\"462\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\/public\" alt=\"Pasting WordPress cookie notice code to header.php file\" class=\"wp-image-19758\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\/w=1163,fit=scale-down 1163w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\/w=768,fit=scale-down 768w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/header-php-file-on-wordpress.png\/w=990,fit=scale-down 990w\" sizes=\"auto, (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><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\">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><div class=\"protip\">\n                    <h4 class=\"title\">Learn Other Advanced WordPress Techniques<\/h4>\n                    <p><a href=\"\/ng\/tutorials\/wordpress-pagination\">WordPress Pagination Guide<\/a><br>\n<a href=\"\/ng\/tutorials\/wordpress-privacy-policy\">How to Add a WordPress Privacy Policy Page<\/a><br>\n<a href=\"\/ng\/tutorials\/wordpress-lazy-load\">Guide to Lazy Loading on WordPress<\/a><br>\n<a href=\"\/ng\/tutorials\/wordpress-excerpt-length\/\">WordPress Excerpt Length: What It Is, How to Change It + Plugin Recommendations<\/a><br>\n<a href=\"\/ng\/tutorials\/wordpress-a-b-testing\">A\/B Testing With WordPress: Best Practices and Tools to Optimize Conversion<\/a><br>\n<a href=\"\/ng\/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=\"\/ng\/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":[22637],"tags":[],"class_list":["post-649","post","type-post","status-publish","format-standard","hentry","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\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":21,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/649\/revisions"}],"predecessor-version":[{"id":145434,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/649\/revisions\/145434"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}