Why Discord Webhook Embed Fields Show in Wrong Order Despite Definition
🔍 WiseChecker

Why Discord Webhook Embed Fields Show in Wrong Order Despite Definition

When you send a webhook to Discord with an embed that contains multiple fields, the fields may appear in a different order than you defined in your JSON payload. This happens even when you list the fields in the correct sequence inside the fields array. The root cause is how Discord processes the inline property on each field object. When some fields are set to inline and others are not, Discord rearranges fields to fill each row based on the inline grouping logic. This article explains why the order changes and how to enforce your intended sequence.

Key Takeaways: Discord Webhook Embed Field Order

  • Set all fields to inline: false or all to inline: true: This forces Discord to respect the array order without row-based reordering.
  • Remove the inline property entirely: Discord treats omitted inline as false, preserving the defined sequence.
  • Use a single row of inline fields with a maximum of three per row: Discord fills rows left to right; mixing inline and non-inline breaks the order.

ADVERTISEMENT

Why Discord Reorders Embed Fields

Discord’s embed layout engine groups fields by their inline property. When you set a field to inline: true, Discord places it in a horizontal row alongside other inline fields. A row can hold up to three inline fields. Fields with inline: false or the default value occupy their own full-width row. This grouping does not respect the array index. Instead, Discord collects all inline fields from the entire array, renders them in rows from left to right, then renders the non-inline fields below them in the order they appear in the array. If you mix inline and non-inline fields, the rendered order will not match your JSON definition.

The second factor is the row fill behavior. Discord tries to balance rows so that no row has fewer than three fields unless it is the last row of inline fields. If you define inline fields in a sequence that would leave a row with only one field, Discord may shift fields from later positions to fill the earlier row. This shift changes the visual order even among fields that are all inline. For example, a field defined fifth in the array may appear second in the embed because it was moved to fill an incomplete row.

How the Inline Property Works

The inline property is a boolean that defaults to false. When set to true, the field sits next to other inline fields on the same line. Discord measures the width of each inline field as roughly one-third of the embed width. If you send four inline fields, Discord places the first three on row one and the fourth on row two by itself. This row-based grouping overrides the array order because Discord treats inline fields as a separate group that must fill rows before non-inline fields are rendered.

Steps to Enforce the Correct Field Order

  1. Set all fields to non-inline
    Change every field object in your JSON payload to "inline": false or remove the inline property entirely. This tells Discord to render each field on its own row, preserving the array order exactly as defined.
  2. If you need inline fields, make them all inline
    Set every field to "inline": true. Discord will then render them row by row, left to right, following the array order. However, ensure the total number of fields is a multiple of three to avoid empty spaces or reordering. For example, use 3, 6, or 9 fields.
  3. Group inline fields together at the end of the array
    Place all inline fields after all non-inline fields in your JSON array. Discord will render the non-inline fields in order first, then render the inline fields in rows. This separation prevents the inline row-filling logic from interfering with the non-inline sequence.
  4. Limit inline fields to three per row
    If you have more than three inline fields, split them into groups of three and insert empty placeholder fields with "name": "​" and "value": "​" and "inline": true to fill rows. This prevents Discord from moving fields between rows.
  5. Test the payload with a webhook tester
    Use a tool like Discord’s webhook tester or a third-party service like Discohook to send the embed and inspect the rendered output. Compare the field order in the JSON to the embed appearance. Adjust the inline settings until the order matches.

ADVERTISEMENT

If Discord Still Shows Fields in Wrong Order

Fields defined inside a nested embed object

If you are using a library or framework that constructs the embed object, verify that the library does not sort or reorder the fields array before sending. Some libraries apply their own formatting logic. Check the raw JSON payload that is actually transmitted. You can do this by logging the payload or using a proxy tool like Wireshark or Postman.

Inconsistent field names causing visual confusion

If two fields have identical names, you may misidentify which field appears in which position. Use unique field names temporarily to confirm the order. After verifying, you can rename them back.

Webhook caching or rate limiting

Discord caches webhook responses for a short period. If you send the same payload multiple times, the cached version may display. Wait a few seconds between tests or change a field’s value to force a new response. Rate limiting can also delay the display of the updated embed. Check the X-RateLimit-Remaining header in the response.

Item All Non-Inline Fields All Inline Fields Mixed Inline and Non-Inline
Order preservation Exact array order Row order, left to right Inline fields grouped first, then non-inline
Row behavior One field per row Up to three fields per row Inline rows fill before non-inline rows
Best use case Long lists of text Short data pairs like stats Not recommended

Discord webhook embed field order is controlled entirely by the inline property. To guarantee your defined sequence, set all fields to non-inline or all to inline. If you must mix, place inline fields after non-inline fields and limit each row to three inline fields. Use a webhook tester to verify the output before deploying the webhook to production.

ADVERTISEMENT