Missing WooCommerce Order Numbers

WooCommerce Sequential Order Numbers

I received an email from one of my WooCommerce web design clients recently. He noticed that there appeared to be large gaps in his WooCommerce order numbers, and was concerned that several orders had got lost somehow.

Obviously when a client thinks they are losing business, this rings immediate alarm bells, and the first person they look to for answers is their web developer.

Why Are There Gaps In My WooCommerce Order Numbers?

I was sure there was a reasonable explanation for the missing order numbers, and I was right! However, in order to fully understand the reason behind the problem, you need to get to grips with how WordPress works in the background.

The WordPress core infrastructure applies a sequential “ID” to every item of content, including images, posts, pages & of course WooCommerce orders. So your WooCommerce invoice number is actually a WordPress core ID.

So, for example, if you received a shop order at midday with the invoice/order number of #2345, and you then added 2 new images to the website between receipt of that order and the next, the images would be allocated the ID’s of 2346 and 2347.

If you then received another order after adding those two images, that order ID would be #2348.

Hence, in your WooCommerce orders page, it would appear that invoices #2346 & #2347 were missing, but in fact, as I have illustrated, this isn’t strictly true, because those numbers were applied to the images you added.

Good Accounting Practice

So while we’ve established why the problem is happening, it’s an issue that could still present confusion in your accounting.

Many accountants will tell you that gaps in invoice numbers can raise queries by HMRC, so sequential invoice numbers are generally seen as good practice.

So how do you achieve correct sequential invoice numbers in WooCommerce?

Fortunately, there is a WooCommerce sequential order number plugin available that corrects the issue. Personally, I think such functionality should be built into the WooCommerce core, but increasingly with free applications like WooCommerce, many key features are paid options, providing the developers with ready income.

Whether you agree or not, this approach allows you to completely personalise your own particular installation to your requirements.