Compliance

GDPR, Cookies and Consent on WordPress: A Practical Guide for Site Owners

GDPR, Cookies and Consent on WordPress: A Practical Guide for Site Owners

Privacy compliance is one of those topics that makes website owners anxious. Everyone has seen cookie banners, heard about large fines and read conflicting advice about what’s required. Many small businesses either ignore it completely or install a banner plugin and assume they’re covered.

Neither approach is quite right. The rules can seem complicated, but the core principles are fairly clear: be transparent about what data you collect, only collect what you need, get proper consent where it’s required and respect people’s rights over their data.

I’m a developer, not a lawyer, so treat this as practical technical guidance rather than legal advice. If your business handles sensitive data or operates at scale, get proper legal input. But for most WordPress sites, understanding the principles and the technical setup goes a long way.

Which laws apply to you?

The best-known privacy law is the European Union’s General Data Protection Regulation, or GDPR. The UK has its own closely related version. GDPR applies not only to businesses in Europe but to any business that offers goods or services to people in the EU or monitors their behaviour.

Cookies and similar tracking technologies are covered by separate rules too, often called the ePrivacy rules, which require consent before storing non-essential information on a visitor’s device.

Other regions have their own laws. California has privacy legislation with specific rights for residents. India has the Digital Personal Data Protection Act. Many other countries have similar frameworks. The details differ, but the principles overlap: transparency, purpose limitation, security and individual rights.

If your site has visitors from regulated regions, and most sites do, it’s sensible to build your setup around these principles.

What counts as personal data?

Personal data is any information that can identify a person, directly or indirectly. On a typical WordPress site, that includes:

  • Names, email addresses and phone numbers from contact forms.
  • Comment author details, including IP addresses.
  • Customer data from WooCommerce orders.
  • User account information.
  • IP addresses and identifiers collected by analytics and advertising tools.
  • Data collected by embedded content, such as videos and maps.

That last point surprises many people. When you embed a YouTube video or a Google Map, those services may set cookies and collect data about your visitors, even if they never click play.

Understanding cookies and consent

Cookies are small files stored in a visitor’s browser. Some are essential for the site to work, others track behaviour for analytics or advertising.

Essential cookies

Cookies needed to provide a service the visitor requested don’t usually require consent. Examples include login session cookies, shopping cart cookies and security cookies. You should still explain them in your privacy or cookie policy.

Non-essential cookies

Analytics, advertising, social media tracking and most third-party embeds use cookies that aren’t strictly necessary. Under European rules, these require consent before they’re set.

Consent has to meet certain standards. It must be freely given, specific, informed and unambiguous. In practice, that means:

  • No pre-ticked boxes.
  • Rejecting should be as easy as accepting.
  • Visitors must be able to choose categories, such as accepting analytics but not advertising.
  • Non-essential scripts must not run before consent is given.
  • Visitors should be able to change their mind later.

That fourth point is where many sites fail. A banner that says “we use cookies” while analytics and ad pixels load in the background isn’t compliance; it’s decoration.

Setting up a consent banner on WordPress

A good consent management plugin or platform does several things:

  1. Scans your site to identify cookies and scripts.
  2. Shows a banner with clear accept, reject and settings options.
  3. Blocks non-essential scripts until the visitor consents to the relevant category.
  4. Records consent so you can demonstrate it if needed.
  5. Lets visitors change their preferences at any time, usually through a link or icon.

When choosing a solution, test it properly. Open your site in a private browser window, open developer tools and check which cookies and network requests appear before you click anything. If analytics or advertising cookies appear before consent, the setup isn’t working.

Blocking scripts properly

The hardest part technically is making sure scripts only run after consent. Scripts added by plugins, themes or manually in the header all need to be managed. Approaches include:

  • Using the consent tool’s own script blocking, which rewrites or delays scripts until consent.
  • Loading tracking through a tag manager configured to respect consent.
  • Replacing embeds, like YouTube videos and maps, with placeholders that load the real content only after the visitor agrees.

Google Consent Mode

If you use Google Analytics or Google Ads, Google’s Consent Mode lets your consent tool tell Google tags what the visitor agreed to. Tags then adjust their behaviour. Since 2024, Google has required Consent Mode for advertisers who want to keep using measurement and personalisation features for users in the European Economic Area. Most reputable consent plugins support it, but you need to configure it and verify it works.

Your privacy policy

Every site that collects personal data needs a clear privacy policy. WordPress helps here: under Settings, then Privacy, you can create a privacy policy page from a template, and many plugins add suggested text about the data they collect.

Treat the template as a starting point, not a finished document. Your policy should explain, in plain language:

  • Who you are and how to contact you.
  • What personal data you collect and how.
  • Why you collect it and the legal basis for doing so.
  • Who you share it with, such as payment providers, email services and analytics tools.
  • How long you keep it.
  • How you protect it.
  • What rights people have and how to exercise them.
  • How you use cookies.

Keep it accurate. A policy copied from another site, mentioning services you don’t use and missing ones you do, isn’t much better than having none.

Forms and data collection

Contact forms are one of the most common ways WordPress sites collect personal data. A few good practices:

  • Collect only what you need. If you only need a name and email to respond, don’t ask for a phone number and address.
  • Explain what happens to the data. A short line under the form, with a link to your privacy policy, is usually enough.
  • Don’t add marketing consent by default. If you want to add people to a newsletter, use a separate, unticked checkbox.
  • Think about storage. Many form plugins store every submission in the database forever. Decide how long you need submissions and delete old ones.
  • Secure the data. Form entries often contain personal information. Keep the site secure and limit who can view submissions.

WordPress’s built-in privacy tools

Since version 4.9.6, WordPress includes tools to help with data requests:

  • Export Personal Data generates a file of the personal data WordPress and supporting plugins hold about a person, identified by email address.
  • Erase Personal Data removes or anonymises that data.

You’ll find both under the Tools menu. They only cover data from WordPress core and plugins that integrate with these tools, so check whether your form, membership and email plugins support them. If not, you’ll need to handle requests for that data manually.

Third-party services

Your website probably shares data with several outside services: hosting, email marketing, payment providers, analytics, CRM tools and more. Each one is processing personal data on your behalf.

For GDPR purposes, you should have data processing agreements with these providers. Most reputable services offer them as part of their terms or as a downloadable document. Keep a simple list of the services you use, what data they receive and where their agreements are.

Be thoughtful about where data goes, too. Transfers of personal data outside certain regions come with extra requirements, and providers usually explain how they handle this in their documentation.

Security is part of privacy

Privacy laws require you to protect the personal data you hold. A hacked site that leaks customer information is a privacy problem as well as a security one. Keep WordPress updated, use strong authentication, restrict admin access, take secure backups and use HTTPS everywhere. In regulated regions, serious breaches may need to be reported to authorities within strict time limits, so having good security and monitoring helps you respond quickly if something goes wrong.

Frequently asked questions

Do I need a cookie banner if I only use essential cookies?

Generally, consent isn’t required for strictly necessary cookies, so a full consent banner may not be needed. You should still explain your cookies in your privacy or cookie policy. Check carefully, though: many sites that think they only use essential cookies have analytics, embeds or plugins setting others.

Is a cookie banner plugin enough to be compliant?

Not on its own. The banner must actually block non-essential scripts until consent, your privacy policy must be accurate and you need processes for data requests and security. The plugin is a tool, not complete compliance.

Do I need to comply if my business isn’t in Europe?

If you offer goods or services to people in the EU or UK, or track their behaviour, GDPR may apply regardless of where you’re based. Other regions also have their own laws. Many businesses adopt one consistent, privacy-respecting approach for all visitors.

Can I use Google Analytics legally?

Many businesses do, with proper consent, accurate disclosure and appropriate configuration. Requirements have shifted over time in some regions, so check current guidance for your markets. Privacy-focused analytics tools that don’t use cookies are another option some site owners prefer.

Final thoughts

Privacy compliance isn’t about scaring visitors with banners or drowning them in legal text. It’s about respecting the people who use your site: telling them honestly what you collect, asking permission when you should, collecting only what you need and keeping it safe. Set up your WordPress site with those principles in mind, test that your consent tools actually work and review your setup when you add new services. That puts you in a far stronger position than most sites on the web.