How to Add a Cookie Policy to Craft CMS

Last updated on June 1, 2026

This guide will walk you through how you can generate and add a Cookie Policy page on your Craft CMS website. A Cookie Policy is a document that provides detailed disclosure about the types of cookies used on a website and their purposes. It will help your website comply with privacy laws like the GDPR and ePrivacy Directive.

To begin with, Sign up on CookieYes and try it for free.

Note

After you Sign up, you will be directed to the installation screens. You can install the cookie banner to get GDPR compliant for your use of cookies. If you prefer to create a Cookie Policy first, skip the installation and go directly to the CookieYes Dashboard.

You can follow the step-by-step instructions below to easily add a Cookie Policy to your Craft CMS website.

Generate a Cookie Policy in CookieYes

Step 1. Access the Cookie Policy Generator

You can access the Cookie Policy Generator by following the below steps:

  1. Log in to your CookieYes account.
  2. Go to More > Cookie Policy Generator.
cookieyes_dashboard

Step 2. Configure Language Settings

  • Select your primary language. The chosen language will appear with a checkmark.
  • (Optional) Enable Generate policy in multiple languages to add more languages. This feature is available on Basic, Pro and Ultimate plans.
  • Click Save draft to save your progress or Next to continue.
language_settings

Step 3. Add About cookies details

In the About cookies section, edit the heading and description to explain what cookies are and why your website uses them. You can keep the default text or edit it to match your website’s practices.

about_cookies

Step 4. Add Use of cookies details

In the Use of cookies section, describe how your website uses cookies (for example, functionality, analytics, performance, or advertising). You can keep the default text or update it for accuracy.

When ready, click Preview cookie policy to review the formatting and tone before proceeding.

use_of_cookies

Step 5. Review and Edit Types of cookies

In the Types of cookies section, you will see a list of cookies from your most recent website scan. If needed, you can refresh the list by clicking Scan again to capture any new cookies. The cookies are organised into categories such as Necessary, Functional, Analytics, Performance and Advertisement. Review each entry carefully to verify the cookie name, duration, and purpose for accuracy.

types_of_cookies

Step 6. Set Cookie Preferences and Generate the Cookie Policy

In the Cookie preferences section, keep the default heading (Manage cookie preferences) and description, or update them with instructions specific to your users. Set the Effective Date for the cookie policy. Preview the policy to verify the details and when confirmed, click Generate cookie policy to generate the policy.

set_cookie_preferences

Note

The Revisit consent widget enables your website visitors to manage their cookie preferences. You can remove the code in the field if you don’t want a widget to be displayed. For more details, refer to the guide.

Add the Cookie Policy to Craft CMS

After generating your Cookie Policy, review the preview in your selected language(s). When ready, click Add policy to site in the top-right corner.

add_policy_to_site

A modal window will appear. Follow the below steps to add your Cookie Policy:

Step 1. Copy the Cookie Policy

  1. Choose your preferred method for adding the Cookie Policy to your Craft CMS website:
  • Option A: Code snippet (Recommended): Keeps your Cookie Policy automatically updated.
  • Option B: HTML format: Requires manual updates whenever the Cookie Policy changes.
add_policy_to_site
  1. Select your preferred language.
  2. Click Copy code to copy the code provided.

Tip

You can also share the code with a developer or your team by clicking on Send code to a teammate. Enter the email address and then click on Send Instructions. The recipient will get the code and instructions via email.

Step 2. Create a Cookie Policy Page in Craft CMS website

  1. Log in to your Craft CMS website.
  2. Go to Settings > Fields > + New field.
new_field
  1. In the Create a new field page, complete the following details:
  • In the Name field, enter a title for the field, e.g., Body HTML.
  • In the Handle field, enter how you refer to the field in templates, e.g., bodyHtml.
  • Set the Field Type to Plain Text.
  • Click Save to proceed.
create_new_field
  1. Navigate to Settings > Sections. Click + New section.
new_section
  1. In the Create a New Section page, complete the following details:
  • In the Name field, enter a title for the section, e.g., Cookie Policy.
  • In the Handle field, enter how you refer to the section in templates, e.g., cookiePolicy.
  • Set the Section Type to Single.
  • Click + Create to add an entry type for this section and provide a name and handle, e.g., Cookie Policy.
  • Click Save to proceed.
create_new_section
  1. From the Sections list, select the Cookie Policy section to view its entry types, then select the desired Entry Type.
choose_entry_type
  1. Drag the Body HTML field from the available fields list into the Field Layout and click Save.
add_body_html

Step 3. Embed the Cookie Policy code

  1. In the Craft CMS dashboard, navigate to Entries. Click the Cookie Policy entry to open its editor.
choose_entry_type_editor
  1. In the Body HTML field, paste the Code snippet/HTML format copied from CookieYes.
paste_the_code
  1. Click Save.
click_save

Your Cookie Policy page will be live on your Craft CMS website. You can then link your Cookie Policy to your website footer, or link it within your cookie banner.

Conclusion

By following this guide, you can easily generate a Cookie Policy in CookieYes and publish it on your Craft CMS website. A properly configured Cookie Policy not only builds trust with your users but also helps your website meet privacy requirements such as the GDPR.

With CookieYes, you have a flexible, compliant and up-to-date solution to manage cookies and privacy transparency on your Craft CMS website.

Was this article helpful?

Have more questions?

Reach out to us and we'll answer them.

Contact us