Why Are There Gaps in My WooCommerce Order Numbers?

Why WooCommerce Order IDs Skip Numbers

Every time a customer reaches the point of an order record being created — even if they abandon checkout before completing payment, or a payment attempt fails outright — WooCommerce creates that order in the database with the next available ID, in whatever status reflects what actually happened (Pending, Failed). These orders are often hidden from the default admin view or simply not noticed, but they still consumed a number in the sequence, which is why gaps appear in the numbers a store actually sees and processes.

Common Causes of Gaps

  • Abandoned checkouts that created a pending order but were never completed, quietly consuming an ID.
  • Failed payment attempts, which create a real order record marked Failed even though no successful transaction occurred.
  • Test orders placed during setup or testing that were later deleted, leaving a gap where that ID used to be.
  • Orders genuinely deleted (rather than cancelled), which removes the visible record but doesn't renumber subsequent orders to close the gap.

What to Do About It

  1. Recognize that this is expected, not a sign of data loss, especially for a store with any meaningful checkout abandonment rate.
  2. If sequential, gap-free invoice numbers are required for accounting/legal reasons, a dedicated sequential invoice numbering plugin (separate from the underlying order ID) is the correct solution, rather than trying to force the order ID itself to be gap-free.
  3. Review abandoned/failed order volume periodically if the gap rate seems unusually high, since it can be a useful signal about checkout friction worth investigating separately.

Finding out what the gaps actually are

  1. Look through the other statuses. Check Failed, Pending payment, Cancelled and the Trash for the missing numbers. Many of them are sitting there.
  2. See whether gaps cluster around failures. A run of skipped numbers near failed payments matches abandoned or declined checkouts.
  3. Know where the numbers come from. With the traditional order storage, orders are posts, so they draw from the same ID sequence as pages, media, revisions and menu items. Any other content created in between consumes numbers too, which makes gaps normal and not a sign of lost orders.

When gap-free numbers are required

Some jurisdictions require invoice numbers to run without gaps. The right answer is a separate invoice-numbering plugin, with its own sequence that is only assigned to completed sales, and not an attempt to force the order ID to behave. If this applies to you, confirm the exact rule with your accountant before choosing a plugin.

Need proper sequential invoice numbering set up for accounting compliance? See custom WooCommerce development.

Available for new projects

NEXT STEP

Rather have it fixed than keep reading?

Based in Dhaka, Bangladesh — serving clients worldwide. Tell me what's happening and you'll have a reply within one working day.

  • Reply within one working day
  • Fixed quote before work starts
  • UK, EU and US hours covered