Sequential Custom Order Numbers for WooCommerce
Gapless sequential order numbers in your own format: prefix, date tags, zero padding, yearly or monthly resets, and numbering for existing orders.
- Block cart and checkout
- Classic cart and checkout
- High-performance order storage
- WooCommerce 9 – 11
- WordPress 6.6 – 7.1
- PHP 7.4+
What Order Numbers does
WooCommerce numbers orders by their database ID, so numbers jump around and leak how many posts your site has. This plugin gives every order the next number in a sequence, formatted the way your accountant, your invoices and your customers expect.
Order Numbers features
Features
- Consecutive numbers with no gaps, drawn atomically so two simultaneous checkouts never share a number.
- Any format with placeholders:
{number},{year},{year2},{month},{day},{hour},{minute},{order_id},{customer_id}. Example:WEB-{year}-{number}. - Zero padding to a minimum number of digits, for example 00042.
- Choose the first number, and set the next number at any time to skip ahead.
- Reset the counter every year, month or day.
- Number orders when they are created, or only once they are placed or paid, so pending, failed and cancelled checkouts leave no gaps.
- Checkout drafts from the block checkout and admin auto-drafts never consume a number.
- Number existing orders in one click, oldest first, in batches that keep working on large stores.
- The number appears everywhere WooCommerce shows an order number: admin, My Account, emails, invoices from other plugins, the REST API and the order tracking form.
- Search the orders screen by the custom number, with or without High-Performance Order Storage.
- Customers can look up an order on the tracking form with the custom number.
- Helpers for developers:
scon_get_order_id_by_number(),scon_assign_order_number(), thescon_format_valuesfilter and thescon_number_assignedaction.
Four formats and what they are for
WooCommerce numbers orders by database ID, so a store's third order can be #1847 and the next #1903, and anyone can work out how busy you are. The format is one line of placeholders under WooCommerce > Settings > Order numbers, with a live preview.
| Format | Example | Used for |
|---|---|---|
| {number}, padded to 5 digits | 00042 | A plain gapless sequence for a store that just wants tidy numbers |
| WEB-{year}-{number}, yearly reset | WEB-2026-0001 | Accountants who file by year; the counter restarts each January |
| INV{year}{month}-{number}, monthly reset | INV202611-017 | Stores that close their books monthly |
| {year2}{month}{day}-{number}, daily reset | 261031-3 | Warehouses that pick by day |
| {number}-{customer_id} | 1042-318 | Support teams that want the customer visible in the number |
Numbers are drawn in a single database statement, so two checkouts finishing at the same moment never share one. You choose when a number is given: when the order is created, or only once it is placed or paid, so pending, failed and cancelled checkouts leave no gaps. Draft orders from the block checkout and admin auto-drafts never take a number. The number shows everywhere WooCommerce shows one: admin, My Account, emails, invoice plugins, the REST API and the order tracking form, and the orders screen searches by it.
What it does well, and what it leaves to other tools
Invoice plugins number invoices, which is not the same thing: the order number is what the customer quotes, what appears in the chat alert and the spreadsheet, and what support searches for. This plugin changes only the displayed number, never the ID, so order links, the REST API and other plugins keep working, and switching it off breaks nothing. Existing orders can be numbered in one click, oldest first, in batches that keep going on large stores, and the format can change later without touching old orders. High-performance order storage and the block checkout are both supported.
What it does not do: PDF invoices, a separate invoice or credit-note sequence, or different sequences per currency, country or sales channel. One sequence, one format, applied to every order.
How to set up Order Numbers in WooCommerce
- 1
Upload the plugin to
/wp-content/plugins/or install it from the Plugins screen. - 2
Activate it.
- 3
Go to WooCommerce > Settings > Order numbers, set your format and save.
- 4
Optionally click "Number existing orders" so older orders follow the same scheme.
Questions about Order Numbers
Will existing orders change?
No. Orders keep the number they were given. Orders from before the plugin show their ID until you number them with the "Number existing orders" button, which numbers them oldest first.
Is the sequence really gapless?
Yes for the orders that are numbered. The counter is increased in a single database statement, so parallel checkouts cannot collide. Choose "The order is placed or paid" if you want paid orders to be gapless even when pending or failed checkouts are deleted later.
Can I change the format later?
Yes. New orders use the new format; existing orders keep their numbers.
What happens after a yearly or monthly reset?
The counter starts again from the "Start at" number. Include {year} or {month} in the format so numbers stay unique across periods.
Does it work with the block checkout?
Yes. It supports both the classic and the block-based cart and checkout, and ignores the draft orders the block checkout creates while the customer is still filling in the form.
Does it support High-Performance Order Storage?
Yes.
Does it change order IDs or URLs?
No. The ID stays the same internally; only the displayed number changes, which is also why nothing breaks when you switch the plugin off.
Order Numbers changelog
- 1.0.0
- Initial release.
Plugins that pair with Order Numbers
Order Export CSV
Export orders to CSV: saved profiles, 90+ columns plus custom meta, filters, one row per order or per item, scheduled email exports, bulk action, WP-CLI.
View plugin
Custom Order Statuses
Add your own order statuses such as Packed, Awaiting pickup or Ready to ship, with colours, bulk actions and safe deletion.
View plugin
Orders to Google Sheets
Every WooCommerce order in a Google Sheet, automatically. Rows update when an order changes status or is refunded. No Google Cloud project needed.
View plugin