{"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-12-02T15:43:15","modified_gmt":"2025-12-02T15:43:15","slug":"how-to-display-wordpress-cookie-notice","status":"publish","type":"post","link":"\/ca\/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<\/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=\"\/ca\/tutorials\/complete-wordpress-gdpr-guide\/\">WordPress GDPR<\/a>.<\/p><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-wordpress-hosting\" href=\"\/ca\/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\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-111781\"  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\" 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\"><figure class=\"aligncenter\"><a href=\"https:\/\/www.hostinger.com\/ca\/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\"  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\/ca\/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\"  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=\"\/ca\/tutorials\/wordpress\/how-to-login-to-wordpress-dashboard\/\">WordPress dashboard<\/a> and navigate to<strong> Appearance -&gt; <a href=\"\/ca\/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\"  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            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Pro Tip                <\/p>\n            <\/div>\n            <p class=\"protip__content\">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\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            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Learn Other Advanced WordPress Techniques                <\/p>\n            <\/div>\n            <p class=\"protip__content\"><a href=\"\/ca\/tutorials\/wordpress-pagination\/\">WordPress Pagination Guide<\/a><br>\n<a href=\"\/ca\/tutorials\/wordpress-privacy-policy\/\">How to Add a WordPress Privacy Policy Page<\/a><br>\n<a href=\"\/ca\/tutorials\/wordpress-lazy-load\/\">Guide to Lazy Loading on WordPress<\/a><br>\n<a href=\"\/ca\/tutorials\/wordpress-excerpt-length\/\">WordPress Excerpt Length: What It Is, How to Change It + Plugin Recommendations<\/a><br>\n<a href=\"\/ca\/tutorials\/wordpress-a-b-testing\/\">A\/B Testing With WordPress: Best Practices and Tools to Optimize Conversion<\/a><br>\n<a href=\"\/ca\/tutorials\/how-to-hide-page-title-wordpress\/\">How to Hide Page Title in WordPress<\/a><\/p>\n                    <\/div>\n        \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=\"\/ca\/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":[22694,22692],"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":1},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/aviso-cookies-wordpress\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/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-GB","link":"https:\/\/www.hostinger.com\/uk\/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},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/aviso-cookies-wordpress\/","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/649","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/comments?post=649"}],"version-history":[{"count":21,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/649\/revisions"}],"predecessor-version":[{"id":140152,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/649\/revisions\/140152"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/media?parent=649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/categories?post=649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/tags?post=649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}