Skip to content
GPLWP Guides

How to create sequential order numbers in WooCommerce

WooCommerce Time About 25 minutes 7 steps Updated 8 Oct 2026

WOOCOMMERCE
The short answer

WooCommerce does not create clean sequential order numbers by default because order IDs are shared with other WordPress content. A code filter can reformat the number shown to customers, but a plugin is the practical route for a separate sequence with prefixes, suffixes and a chosen starting number.

The route
  1. 01Check your current order numbering
  2. 02Back up before changing numbers
  3. 03Use code for display-only changes
  4. 04Install a sequential-number extension
  5. 05Set the format and exclusions
  6. 06Place a test order and check integrations
  7. 07Use the fast way when needed

What you need

  • A WooCommerce store with administrator access
  • A recent backup or staging copy of the site
  • A clear starting number and format for the sequence
  • Access to a child theme or code-snippets tool if using custom code

Check your current order numbering

Open WooCommerce > Orders and note the largest order number currently in use. WooCommerce normally displays the underlying order ID, and those IDs are not sequential because WordPress assigns IDs to other content as well.

Decide whether you need a new display format only, such as SHOP-1234, or a separate sequential counter that starts at a chosen number. The second requirement needs more than a simple formatting change.

Back up before changing numbers

Create a backup and, if possible, make the change on a staging site first. Record your current highest order ID and take note of systems that read order numbers, such as payment gateways, invoices, fulfilment tools, exports and customer emails.

Do not edit order IDs directly in the database. WooCommerce uses the underlying ID to retrieve orders, while the order number is primarily the value shown and passed to compatible integrations.

Use code for display-only changes

If you only need a prefix or suffix, add a small PHP filter through a child theme or a code-snippets tool. The confirmed WooCommerce filter is woocommerce_order_number; it changes the value returned for display, while the underlying order ID remains unchanged.

This is not a true sequential-number system. A filter that adds SHOP- to the existing ID will still show gaps whenever WordPress has assigned IDs to products, pages, revisions or other records. Do not use this route if accounting or fulfilment requires its own consecutive counter.

Install a sequential-number extension

For a genuine sequence, install a WooCommerce order-number extension, activate it, and open its settings. WooCommerce documents the Sequential Order Numbers Pro setup under WooCommerce > Settings > General, where you can set the starting number, minimum length, prefix and suffix.

Choose a starting number higher than your current largest order number. Existing orders normally keep their current numbers, while new orders continue from the larger of the configured starting value or the existing highest number.

Set the format and exclusions

Enter the format you actually want customers and staff to see, such as WEB-{YYYY}{MM}-0001, then save the settings. If the extension supports date tokens, fixed-width numbers or separate treatment for free orders, configure those before taking live orders. The documented extension supports prefixes, suffixes, date and time patterns, padded numbers and optional handling for free orders.

Avoid changing the format repeatedly after orders have been issued. Some extensions update how existing numbers are displayed, while others leave historical values unchanged, so check the extension's documentation before switching formats.

Place a test order and check integrations

Place a test order using the same checkout experience your customers use, including the Checkout block if it is enabled. Check the number in the Orders screen, the confirmation page, emails, payment gateway, invoice and any fulfilment or accounting connection.

Watch for gaps after abandoned or automatically created checkout drafts. Support reports have identified Checkout block draft orders that receive numbers before the customer confirms payment, so a sequence can still contain gaps unless the extension handles those drafts specially.

Use the fast way when needed

The fast route is WooCommerce Sequential Order Numbers Pro: install it from the WordPress plugin uploader, activate it, then configure the order-number settings. It is intended for stores that need a separate sequential sequence with a chosen starting number, prefixes, suffixes and padded numbering.

Use the manual filter only for a simple display prefix or suffix. If you need reliable numbering for records, customer support or integrations, the extension saves you from maintaining a counter and handling existing orders yourself.

The fast route

Let WooCommerce Sequential Order Numbers Pro do it

Sequential, customizable order numbers with prefixes and suffixes for stores needing cleaner order tracking and records.

Get WooCommerce Sequential Order Numbers Pro

Sources

  1. woocommerce.com /document/managing-orders/troubleshooting-orders/?utm_source…
  2. woocommerce.com /document/sequential-order-numbers/?utm_source=openai
  3. woocommerce.github.io /code-reference/files/woocommerce-src-admin-api-reports-orde…
  4. wordpress.org /support/topic/sequential-order-numbers-for-woocommerce-stil…

Questions

Does WooCommerce create sequential order numbers by default?
No. WooCommerce normally uses the order's underlying WordPress ID, and those IDs are shared with other content, so gaps are expected. WooCommerce's own troubleshooting documentation recommends an extension when you need sequential order numbers rather than default IDs.
Can I create sequential order numbers with a code snippet?
Not safely with the usual display filter alone. The confirmed <code>woocommerce_order_number</code> filter can change the number shown in WooCommerce, but it does not create a separate counter or change the underlying order ID. Use code for a prefix or suffix; use an order-number extension for a real sequence.
Will changing the starting number rename existing orders?
Usually, no. The documented Sequential Order Numbers Pro settings affect newly placed orders, while existing orders remain unchanged. Set the new starting number above your current largest order number, and verify the extension's behaviour before changing a live store.
Why are there still gaps in my sequential order numbers?
Gaps can occur when a checkout draft or other temporary order receives a number before the customer completes payment. This has been reported with Checkout blocks and some sequential-number extensions. Check whether your extension excludes draft orders, and do not assume that every abandoned checkout will leave the sequence untouched.
Can payment gateways use the custom order number?
Often, yes, but compatibility depends on the gateway. Compatible extensions use WooCommerce's displayed order number, while WooCommerce still uses the underlying order ID internally. Test payment creation, callbacks, refunds and order lookup before relying on a custom number in a live payment workflow.