🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 23, 2026

How to Create Discourse Topics From Gravity Forms Submissions

GravityExtra
How to Create Discourse Topics From Gravity Forms Submissions

A community forum is where your best questions come from, and your website is where most people first ask them. If you run Discourse for your community and Gravity Forms for your forms, it is natural to want the two to work together: someone fills in a form on your site and a topic appears on the forum, with the right category, the right tags and the right author. This article shows how to do that without copying and pasting, and what to think about before you switch it on.

Why send form submissions to a forum?

Forms are good at collecting structured information. Forums are good at keeping it, discussing it and making it easy to find later. Putting the two together gives you a few very practical workflows.

  • Ask the community: a short form on a help page that opens a topic in the Support category, so people do not need to register on the forum before asking.
  • Feature requests and ideas: a form with a title, a description and a drop-down that files the idea in the Ideas category with a tag for the product.
  • Bug reports: a form with the version, the steps to reproduce and a severity that becomes a topic with tags that your team can filter on.
  • Announcements and release notes: your team fills in a form in the WordPress admin and the post appears on the forum.
  • Private messages to staff: a contact form whose answers are sent as a private message to the support group instead of an e-mail that someone may miss.
  • Member onboarding: after a sign-up form, the person gets a forum account, is added to a group and gets a welcome topic.

What the Discourse API needs

Discourse has a documented REST API. Every request carries two headers: Api-Key and Api-Username. You create the key in the forum admin area, under API and Keys. A key can be limited to one user or can act for all users, and it can be limited to certain actions. A new topic is a request to the posts endpoint with a title, the text (in Markdown), a category number and tags. A reply is the same request with a topic number. A private message is a post with the private message type and a list of recipients.

That is simple for a developer, but a real form needs more than the happy path: the category must be found, the tags must be cleaned, a title that is too short must be explained, a visitor must not be able to mention everybody, a failing forum must not lose the submission, and the key must be stored safely. This is what the Gravity Forms Discourse Premium Add-on takes care of.

Step by step: the connection

  1. Create an API key in the Discourse admin area. Choose All Users if you want to post as the members who fill in your form.
  2. In WordPress open Forms → Settings → Discourse, activate your license and enter the forum address, the API user name and the key.
  3. Press Test the connection. The add-on reads your categories and confirms that it can talk to the forum.
The Discourse settings screen: forum address, API user name, a password field for the API key and the Test the connection button with a green result
Forms, Settings, Discourse: the address of your forum, the API user and the key. The key is saved encrypted.

The key is encrypted before it is saved and the field never shows it again, only its last four characters. That matters because anyone with the key can act on your forum.

Step by step: the form and the feed

Build the form as you normally would. A title field, a long text field, a drop-down for the category, a tags field and a name and e-mail address are enough for most topics.

A Gravity Forms form with a title, a question, a category and tag fields that creates a Discourse topic when it is sent
A plain form. The visitor never sees Discourse; the feed does the posting.

Then open the form settings, choose Discourse and add a feed. Pick Create a topic, use the merge tag of the title field as the title and the merge tag of the long text field as the text, choose the category, and put the merge tag of the tags field in the tags setting.

The Discourse feed settings: name, action, title with merge tags, category, tags, the text of the post, who posts and the user sync fields
A feed: what to post, where, and as whom. Merge tags work in the title, the tags and the text.

If you leave the text empty, the add-on writes every answered field as a bold label followed by its value. That is a quick way to get a readable topic from a longer form, such as a bug report.

Choosing the category

You can fix the category in the feed, or let the visitor choose it. For the second case, select the form field that holds the choice. The value of that field can be the category number, its slug (for example billing-help) or its name. The add-on reads the real list of categories from your forum, so a sub category works too, and a value that does not match falls back to the category you chose in the feed.

Tags without surprises

Discourse tags are lower case and cannot contain spaces or most punctuation. A visitor who types Gravity Forms, Billing would otherwise cause an error. The add-on turns that into gravity-forms and billing, removes duplicates and sends at most ten tags.

Posting as the member: user sync

A topic made by a generic account is fine for a support box. For a community it is better when the topic comes from the person who asked, so they get the notifications and can reply. With user sync, the add-on looks for a member with the e-mail address from the form. If it finds one, the post is made as that member. If not, it creates the member with the name from the form, picks a free user name and can add the member to the groups you choose.

Two safeguards are worth knowing about. First, there is a mode that never creates anyone: if no member has the e-mail address, nothing is posted and the note on the entry says why, which suits forms for existing members only. Second, the new member gets a random password that is never shown or saved on your site, so the person signs in with the usual forum login or password reset.

Protecting the forum from the form

  • Mentions: a form field can contain @all or the name of a moderator. By default the add-on breaks every @mention in the text so that a submission cannot notify people.
  • Titles and text: control characters are removed, line endings are normalised and the length is kept within what Discourse accepts.
  • Private networks: the add-on refuses addresses that point to private networks unless you allow them in code, so a typing mistake in the settings cannot turn the site into a way to probe your internal network.
  • Duplicates: one entry creates one post per feed. A retry never posts a second time.

When the forum has a bad day

Forums are updated, rate limited and sometimes briefly unavailable. The visitor should not notice. The add-on saves the entry and shows the confirmation first, then talks to the forum. If the forum answers with a temporary error, a timeout or a rate limit, the post is scheduled again after one minute, five minutes, thirty minutes and two hours, and it respects the number of seconds the forum asks you to wait. Errors that waiting cannot fix, such as a wrong key or a title that is too short, are shown at once in the entry notes with the message from Discourse.

Each entry shows a link to the topic, the user who posted and a note for every step. If a post failed, a button in the entry box sends it again once you have fixed the problem.

Using the topic address in the rest of your form

The add-on adds merge tags for the topic address, the topic number, the post number and the forum user. Use them in the confirmation message to send the visitor straight to the topic, in a notification to your team, or in another feed. A typical confirmation says that the question is now on the forum and shows a link to it.

A quick checklist before you launch

  1. Test the connection and check that the category list matches your forum.
  2. Send a test submission with a short and a long title, because Discourse may have a minimum title length.
  3. Try a text with an @mention and a tag with spaces and see the result on the forum.
  4. If you use user sync, test with an e-mail address that has a member and one that has not.
  5. Look at the entry notes. They tell you exactly what happened.
  6. Decide who may fill in the form. A public form that creates public topics needs a spam check, and Gravity Forms has several.

Frequently asked questions

Do I need the Discourse administrator account?

You need an administrator to create the API key. The key can then be limited to the actions you want. Looking up members by e-mail address needs a key for all users with administrator rights, because Discourse hides e-mail addresses.

Can the form create a reply instead of a topic?

Yes. Give the topic number, from a field or a fixed number, and the post is added as a reply, optionally to a particular post.

What about attachments?

Version 1.0.0 posts text. Add the address of an uploaded file to the text with a merge tag when you want a link to it in the topic.

Is anything sent to a third party?

No. The requests go from your WordPress site to your own forum. The add-on does not send data to GravityExtra.

The Gravity Forms Discourse Premium Add-on turns a form submission into a topic, a reply or a private message on your Discourse forum, with the category, tags and author you choose, and with care for the things that go wrong in real life. See the features, the price and the setup guide on the add-on page.

See the Discourse add-on

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr