Legal Docs

AI-powered legal document generator. Generates Privacy Policy, Terms of Use, Cookie Policy and more for 93 jurisdictions.

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


  1. Download or clone this repository into /site/modules/ProcessLegalDocs/
  2. Go to Admin → Modules → Refresh
  3. Install ProcessLegalDocs
  4. 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

  1. Go to Setup → Legal Docs
  2. Click Generate Documents
  3. Select jurisdictions, language, and document types
  4. Click Generate Selected Documents
  5. Monitor progress in real-time
  6. 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

File format

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();
}


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

More modules by Maxim Semenov

  • Context

    Export ProcessWire site context for AI development (JSON + TOON formats)
  • WireWall

    Advanced traffic firewall with VPN/Proxy/Tor detection, rate limiting, and JS challenge
  • Page Markdown

    Export any page to a clean Markdown file. Adds an export button to the page editor.
  • Subscribe

    Newsletter subscription handler with lists, double opt-in, honeypot, rate limiting and unsubscribe link.
  • AiWire

    AI integration for ProcessWire. Supports Anthropic, OpenAI, Google, xAI, and OpenRouter.
  • Plausible Analytics

    Plausible Analytics dashboard using Stats API v2 with page-edit widget, traffic trends chart, and geo/device tabs.
  • WirePDF

    Convert ProcessWire pages to PDF documents with advanced typography support
  • Ichiban

    Comprehensive SEO module: meta/OG/schema, audit, redirects, revisions, email reports.
  • Legal Docs

    AI-powered legal document generator. Generates Privacy Policy, Terms of Use, Cookie Policy and more for 93 jurisdictions.

All modules by Maxim Semenov

Install and use modules at your own risk. Always have a site and database backup before installing new modules.