Custom Form
Custom form type (Divi 5)
The Custom Form type is for developers who want to control form behavior with code. You use it together with Divi Form Builder's PHP hooks to process submissions, integrate with APIs, or change data.
A full list of available hooks is in Developer hooks.
For developers only The Custom Form type requires custom PHP. For a normal contact form (emails, no custom logic), use the Contact Form type instead. Use Custom Form only when you need custom processing or integrations.
Support We don't support custom code or implementations that use these hooks. We can help with bugs in the hooks or plugin itself. For custom development, contact us through the support channel for after-hours custom development.
When to use this form type
Use Custom Form when you need:
- Submission handling outside built-in form type behaviors
- API/webhook logic with custom request/response handling
- Programmatic processing before or after submission
- Integrations that depend on custom PHP actions or filters
Do not use this type for standard contact, login, registration, or content-submission flows unless those flows must be overridden.
Prerequisites
- Strong familiarity with WordPress PHP hooks and sanitization
- Access to edit plugin or site custom code safely
- A staging environment for testing custom logic
Basic setup flow
- Add the Form module in the Divi 5 builder.
- Set Form Type to Custom Form.
- Add the fields you need and assign unique Field ID values.
- Implement your processing with the documented hooks.
- Validate, sanitize, and securely handle all submitted data.
Verify it works
- Submit the form with test data from the frontend.
- Confirm your custom code runs in the expected order.
- Confirm success/error responses are user-friendly.
- Confirm edge cases (missing fields, invalid input, retries) are handled cleanly.
Common mistakes
- Building custom behavior when a built-in form type already handles the use case
- Not validating and sanitizing each submitted value
- Testing only successful submissions and skipping failure scenarios
- Running custom code directly on production before staging verification