Skip to main content

Discord Integration

Send a rich embed notification to a Discord channel when a form is submitted.

Action type: discord Class: Core_Forms\Actions\Discord Source: src/actions/class-discord.php

Setup

  1. In your Discord server, go to Server Settings > Integrations > Webhooks.
  2. Click New Webhook, select the target channel, and copy the webhook URL.
  3. In WordPress, edit your form > Actions tab > Add Action > Send to Discord.
  4. Paste the Webhook URL.

Settings Reference

Setting Required Default Description
Webhook URL Yes -- Discord webhook URL (https://discord.com/api/webhooks/...)
Bot Name No Core Forms Username displayed for the bot in Discord

Internal settings (not shown in UI):

Setting Default Description
embed_color 3447003 Embed sidebar color as decimal integer (default is blue)

Embed Format

Unlike Slack, Discord sends a rich embed with structured fields rather than plain text. Each form field becomes an embed field:

+------------------------------------------+
| New submission: Contact Form             |
|                                          |
| Name          Email                      |
| Jane Smith    jane@example.com           |
|                                          |
| Message                                  |
| I'd like to learn more about your...    |
|                                          |
| Core Forms              2026-04-09T10:30 |
+------------------------------------------+
  • Title: "New submission: {form title}"
  • Fields: Each form field is displayed as a name/value pair
  • Inline: Fields shorter than 50 characters are displayed inline (side by side)
  • Footer: "Core Forms"
  • Timestamp: ISO 8601 UTC timestamp
  • Max fields: 25 (Discord API limit)

Field Value Handling

  • Array values (checkboxes, multi-select) are joined with commas.
  • Values are truncated to 1024 characters (Discord embed field limit).
  • Empty values display as an em dash.

How It Works

  1. On successful submission, the action builds a Discord embed payload.
  2. Each form field becomes an embed field with the key as the label (underscores replaced with spaces, first letter capitalized).
  3. The payload is POSTed as JSON to the webhook URL.
  4. The request times out after 15 seconds.
  5. Returns true on success, false if the URL is missing or the request fails.

Example

A form with fields name, email, company, and message produces an embed where name, email, and company appear inline (short values) and message appears full-width below them.

Troubleshooting

  • Not receiving embeds: Verify the webhook URL and that the webhook has not been deleted from the server.
  • Missing fields: Discord limits embeds to 25 fields. If your form has more than 25 fields, extras are silently dropped.
  • Changing the color: The embed_color setting is not exposed in the UI. Use the cf_process_form_action_discord filter or modify the setting programmatically.