Display WordPress Cookie Notice: Step-by-Step Guide
In this article
To display a WordPress cookie notice, you need to install a dedicated plugin (or add code to your theme) that shows a banner to visitors, typically asking for consent to store cookies. This guide walks you through the most reliable method using a free plugin, plus manual alternatives. You'll need admin access to your WordPress dashboard and the ability to install plugins.
What You'll Need
- WordPress admin credentials (username and password)
- An active WordPress theme (any standard theme works)
- Optional: a child theme if you plan to edit code directly
Step-by-Step
- Log in to your WordPress dashboard. Go to yourdomain.com/wp-admin and enter your credentials.
- Navigate to Plugins → Add New. In the left sidebar, click “Plugins” and then “Add New.”
- Search for a cookie notice plugin. In the search box, type “cookie notice” or “GDPR cookie consent.” Popular free options include “Cookie Notice & Compliance for GDPR / CCPA” by Hu-manity, “GDPR Cookie Consent” by WebToffee, and “Complianz.” For this guide, we'll use “Cookie Notice & Compliance” as an example.
- Install and activate the plugin. Click “Install Now” on your chosen plugin, then click “Activate” once installation completes.
- Configure the plugin settings. After activation, go to the plugin’s settings page. For “Cookie Notice & Compliance,” you'll find it under Settings → Cookie Notice. Here you can set the message text, button labels, and choose whether to show the notice on all pages or only specific ones.
- Set the consent behavior. Most plugins let you choose between “implicit consent” (banner disappears on scroll or click) and “explicit consent” (user must click “Accept”). For GDPR compliance, explicit consent is safer. Look for options like “Accept button” and “Refuse button” and enable them.
- Customize the appearance. In the same settings, you can change the banner background color, text color, and position (top, bottom, or centered). Some plugins offer a live preview. Adjust until it matches your site’s design.
- Enable cookie blocking (optional but recommended). If your site uses third-party cookies (e.g., Google Analytics, Facebook Pixel), most plugins can block these until the user consents. Look for a setting like “Block scripts” or “Auto-block cookies.” Enable it and list the cookies you want to block.
- Save your changes. Click “Save Changes” or “Update” at the bottom of the settings page.
- Test the notice. Open your site in a new incognito/private browser window. You should see the cookie banner appear. Click “Accept” and verify it disappears. Refresh the page to confirm it doesn’t reappear (unless the plugin is set to show again after a period).
- If you prefer a manual method (no plugin): Add a small JavaScript snippet to your theme’s
footer.phpfile. For example, use a simple script that shows a fixed div at the bottom of the page. This requires more coding knowledge and doesn’t handle consent blocking automatically, so it’s only recommended for advanced users.
Common Mistakes
- Forgetting to enable explicit consent. If you only show a notice without an “Accept” button, you may not be compliant with GDPR or similar laws.
- Not blocking cookies before consent. If you use analytics or advertising cookies, they must not load until the user agrees. Many plugins do this automatically, but you need to enable the blocking feature.
- Placing the notice in a way that blocks the entire site. Some plugins have a “modal” option that forces interaction. While legal, it can annoy users. Use a non-intrusive banner instead.
- Not testing in incognito mode. If you test while logged in or with existing cookies, the notice may not appear, leading you to think it’s broken.
- Ignoring local laws. Different regions have different requirements (e.g., GDPR in Europe, CCPA in California). Make sure your notice and consent mechanism meet the laws that apply to your audience.
Tips
- Keep the message short. A concise notice like “We use cookies to improve your experience. By continuing, you agree to our cookie policy.” is enough. Provide a link to your full privacy policy.
- Use a plugin that supports geolocation. If your audience is global, some plugins can show the notice only to visitors from regions where it’s required (e.g., EU). This reduces annoyance for others.
- Include a “Cookie Policy” page. Before enabling the notice, create a page that explains what cookies you use, why, and how users can manage them. Link to it from the notice.
- Test on mobile. Ensure the banner doesn’t cover important content on small screens. Most plugins are responsive, but double-check.
- Consider a “Reject” button. Some plugins offer a “Decline” option. This is good for user trust, though not always required by law.
Troubleshooting
- The notice doesn’t appear. First, clear your browser cache and cookies, then test in incognito mode. If it still doesn’t show, check that the plugin is activated and that you saved the settings. Also, check if your theme has a caching plugin that might be serving a cached page—clear all caches.
- The notice appears but doesn’t disappear after clicking “Accept.” This usually happens when the plugin’s JavaScript isn’t loading correctly. Try disabling other plugins one by one to see if there’s a conflict. If so, contact the plugin’s support or switch to a different cookie plugin.
- Cookies are still being set before consent. If you enabled blocking but cookies still load, you may have missed some scripts. Check the plugin’s “blocking” settings and add the specific cookie names or script URLs. Some plugins require you to manually add the scripts to a “blocked scripts” list.
- The notice looks broken or overlaps with your theme’s elements. Try changing the banner position (e.g., from bottom to top) or adjusting the z-index via custom CSS. Most plugins have a “custom CSS” field in settings.
- After updating the plugin, the notice disappears. Check if the plugin’s settings were reset. Re-configure them. If the issue persists, roll back to the previous version or contact support.
Frequently Asked Questions
Is a cookie notice legally required?
It depends on your jurisdiction and the types of cookies you use. For example, the GDPR in the EU requires consent for non-essential cookies, while the CCPA in California requires an opt-out option. If you use analytics or advertising cookies, it’s best to have a notice.
Can I use a free cookie notice plugin?
Yes, many free plugins like “Cookie Notice & Compliance” and “GDPR Cookie Consent” offer core functionality. Premium versions add features like geolocation and advanced cookie blocking, but free versions are sufficient for most small sites.
What if my site only uses essential cookies (e.g., login session)?
Essential cookies are exempt from consent in many laws, but you may still need to inform users about them in a privacy policy. A cookie notice is not strictly required, but it’s good practice to mention it.
How do I add a cookie policy page?
Create a new WordPress page, title it “Cookie Policy,” and write a clear explanation. You can also use a plugin like “Cookie Policy Consent” to generate one automatically. Then link to it from your cookie notice.
Will a cookie notice slow down my site?
Most plugins are lightweight and add only a few kilobytes of JavaScript. However, if you use a heavy plugin with many features, it might affect performance. Use a caching plugin and test your site speed after installation.
Can I customize the cookie notice to match my brand?
Yes, most plugins allow you to change colors, text, and position. Some even support custom CSS for full control. You can also use a dedicated “Cookie Banner” plugin that offers more design options.