Legal pages: generate a privacy policy, cookie policy and terms
Describes Legal 0.7.0.
The Legal module writes your site’s legal pages from templates: a privacy policy, a cookie policy, terms of service and others, depending on which privacy laws you choose. It fills them with your company details and saves them as draft posts, which you review, edit and publish.
Where to find it
Open Settings in the admin, then Legal (/admin/settings/legal). The page is called Legal Settings. You need a role with the Legal permission.
The module needs the Publishing module: Legal pages are stored and shown as Publishing posts. Turn Publishing on first, then Legal, on the Modules page. While Publishing is off, the Legal page says “Publishing module is required for Legal pages. Please enable Publishing first.” with an Enable Publishing button. While Legal itself is off, its settings are not shown.
Legal: choose the laws that apply, then generate the pages.
Compliance frameworks
Compliance Frameworks lists the privacy laws you can choose. Tick every one that applies to your visitors; each tick is saved at once.
- GDPR (European Union) and UK GDPR (United Kingdom): require a Privacy Policy and a Cookie Policy.
- CCPA/CPRA (California): requires a Privacy Policy and Do Not Sell My Personal Information.
- US State Privacy Laws, LGPD (Brazil), PIPEDA (Canada) and Generic (Basic): require a Privacy Policy.
Each framework also suggests optional pages, such as Terms of Service. GDPR, UK GDPR, LGPD and PIPEDA ask visitors to opt in, which matters for the cookie banner (see the cookie consent guide).
Company information
Company Information shows the details that go into the pages: company name, registration number, address, VAT number and site URL. They are not edited here:
- Edit Organization opens the organization settings, where the company details live.
- Edit Site URL opens the general settings.
If no company details are set, the card says Company information not configured. If the site URL is missing, it says Site URL not configured.
Data Protection Officer (DPO)
Fill in DPO Name, DPO Email, DPO Phone and DPO Address, then press Save DPO Contact. The section is marked “Required for GDPR compliance. Leave empty if not applicable.”
Two shortcuts copy details you already have and save them straight away:
- The button beside DPO Email (Import from General Settings) copies the site’s sender email.
- The button beside DPO Address (Import from Company Address) copies the organization’s address.
Generating and publishing pages
Legal Pages lists every page your chosen frameworks require or suggest. Until you tick a framework, it says “Select compliance frameworks above to see required pages.”
The table shows each page, the frameworks that list it under Required By (filled badges for required, plain badges for optional), its Status and its actions:
- Generate: writes the page from its template and saves it as a draft. The status then shows the page’s state (draft or published) and a badge per language.
- Regenerate: writes the page again from the template, replacing its text. Do this after you change company details, DPO details or the list of what the site collects. Edits you made to the page by hand are overwritten.
- Edit: opens the page in the Publishing editor, where you change its text.
- Publish: makes a draft page public. Shown only while the page is not published.
Generate All Required Pages generates every page your frameworks require in one go (not the optional ones) and reports how many it generated. If the site has more than one language, a language menu beside it chooses which language to write.
A yellow box reminds you: Legal Review Required. “Generated pages are drafts. Have them reviewed by a legal professional before publishing.”
Published pages are public at /legal/<page>, for example /legal/privacy-policy, and /legal lists all of them. A draft is not visible to visitors.
Fixing broken pages
If the Legal group in Publishing holds pages in the trash, a warning Issues detected with legal pages lists them, with a Reset Legal Pages button. Reset deletes all legal pages and their group, after you confirm. You then generate them again.
What it doesn’t do
- It doesn’t write legal advice. The pages come from fixed templates, filled with your details; a lawyer should review them.
- It doesn’t show the pages itself. Publishing serves them, so their look, translations and editing work like any other Publishing post.
- You can’t put your own page at
/legal: Publishing claims that address. - The Acceptable Use Policy template exists, but no framework lists it, so it doesn’t appear in the table.
For developers
To change a template, place your own copy in your app’s priv/legal_templates/ (for example privacy_policy.eex, or privacy_policy.de.eex for one language). Your copy is used before the bundled one. The module’s README lists the variables a template receives.