Context and constraint
What had to be understood before coding
A public contact form needs to preserve legitimate enquiries while limiting spam, protecting secrets and keeping personal data manageable inside WordPress.
Engineering decision
What was built, changed or isolated
Use layered validation, bounded storage, explicit retention settings and native WordPress privacy hooks instead of treating form delivery as a single email action.
Implementation safeguards
How maintainability, security and rollback were considered
Added nonce checks, honeypot and timing controls, field limits, inquiry allowlists, rate limiting, optional CAPTCHA, safe webhook delivery, lead status tracking, personal-data export and erasure, and scheduled retention cleanup.
Observable result
Layered validation · privacy hooks · retention lifecycle
Created a contact workflow that remains useful when email delivery fails and gives administrators a documented path for data export, erasure and retention.