AI-powered legal document generator for ProcessWire CMS.
Generates Privacy Policy, Terms of Use, Cookie Policy, and other legal documents for 93 jurisdictions in 44 languages — directly from your ProcessWire admin.
Features
- 93 jurisdictions — EU/GDPR, UK GDPR, EEA/GDPR, European country presets, US state privacy laws, Latin America, Africa, Middle East, Asia-Pacific, and Generic/International
- 44 languages — jurisdiction-aware language options covering Europe, the Americas, Asia-Pacific, Middle East, and Africa
- AI-powered — uses Context module AI gateway for intelligent, site-aware generation
- Site analysis — detects personal data fields, features (e-commerce, login, forms), and installed modules
- Markdown output — with YAML frontmatter, saved to
/site/assets/legal/ - Multiple documents — Privacy Policy, Cookie Policy, Terms of Use, Data Processing Agreement, CCPA Notice, Refund Policy, Disclaimer
- Works without AI — generates generic templates based on owner data if Context is not configured
Requirements
- ProcessWire >= 3.0.255
- PHP >= 8.3
- Context module (optional, required for AI generation)
Installation
- Download or clone this repository into
/site/modules/ProcessLegalDocs/ - Go to Admin → Modules → Refresh
- Install ProcessLegalDocs
- Go to Admin → Setup → Legal Docs
Configuration
Go to Admin → Modules → ProcessLegalDocs → Configure:
- Owner Type — Company or Individual
- Company Name / Full Name
- Country, Address, Email, Website
- DPO — Data Protection Officer (optional, required for some GDPR cases)
- Business & Audience — business description, target markets, customer type, children/minors
- Data & Processing — collected data categories, sensitive data, retention summary
- Third Parties — processors, analytics, payment, and email/marketing providers
- Commerce & Policies — cookie consent tool, refund policy, subscription/cancellation terms
- Review & Page Publishing — default review status, reviewer metadata, and optional ProcessWire page publishing
AI settings are inherited from the Context module. If Context is not installed, documents are generated as generic templates.
What “jurisdiction” means
In this module, a jurisdiction is the legal regime or market that the generated document should account for. It is not simply where the website is hosted.
A jurisdiction may be relevant because of:
- where the website owner or company is registered
- where users, customers, or data subjects are located
- where products or services are intentionally offered
- where personal data is processed, stored, or transferred
- which privacy, consumer, or data protection law should shape the document
For example, a US company hosted in Germany may still need documents for California, Delaware, EU/GDPR, UK GDPR, or UAE users if it targets or serves those people. The selected jurisdiction supplies the legal requirements that AI uses when generating each selected document type.
Usage
Generate documents
- Go to Setup → Legal Docs
- Click Generate Documents
- Select jurisdictions, language, and document types
- Click Generate Selected Documents
- Monitor progress in real-time
- Preview, copy, or download generated files
Generated file location
/site/assets/legal/
├── eu_gdpr/
│ ├── privacy-policy.en.md
│ ├── cookie-policy.en.md
│ └── terms-of-use.en.md
├── us_ccpa/
│ └── privacy-policy.en.md
└── generic/
└── privacy-policy.ru.md
Each file includes YAML frontmatter:
---
title: "Privacy Policy"
jurisdiction: eu_gdpr
jurisdiction_name: "EU / GDPR"
language: en
language_name: "English"
generated: 2026-04-28
owner: "Acme Ltd"
website: "https://example.com"
generator: ProcessLegalDocs for ProcessWire
---
> ⚠️ **Legal Disclaimer**
> This document was generated by AI as a template only...
# Privacy Policy
...
Programmatic API
$legal = wire('modules')->get('ProcessLegalDocs');
// Check if document exists
if($legal->getGenerator()->documentExists('eu_gdpr', 'privacy-policy', 'en')) {
// Get full content (with frontmatter and disclaimer)
$content = $legal->getGenerator()->getDocument('eu_gdpr', 'privacy-policy', 'en');
// Get path
$path = $legal->getGenerator()->getDocumentPath('eu_gdpr', 'privacy-policy', 'en');
// List all generated documents
$docs = $legal->getGenerator()->getGeneratedDocuments();
}
Legal Disclaimer
Documents generated by this module are AI-generated templates only.
They do not constitute legal advice.
Laws vary by jurisdiction and change over time.
Always consult a qualified lawyer before publishing any legal document on your website.
License
MIT — see LICENSE
Author
Maxim Alex