The mystery of the missing WooCommerce order numbers
One of our WordPress clients was recently concerned that there were gaps in the ID numbers of the orders on her WooCommerce website.
At first, I assumed that the missing order numbers were due to some test orders that we had deleted as part of the web design process. However, it kept happening so we investigated and discovered a simple plugin to fix the problem.
Why are my WooCommerce order numbers not sequential?
The answer is fairly obvious if you know how WordPress works behind the scenes. However it wasn't obvious to me - and millions of people use WooCommerce, so I'm sure I wasn't alone. I'm writing this post for anyone who is wondering about missing order numbers on their WooCommerce website.
Gaps in WooCommerce order numbers are not caused by a bug or error with the website. In fact, order numbers are not supposed to be sequential.
The way it works is that EVERY item in the WordPress database is given a unique ID number, which is allocated sequentially. This includes orders, pages, posts, images etc. so the numbers are not just used for orders.
For example, someone may place an order which is assigned the ID 17004 and then you might add a new post which is given the ID 17005. The next person who places an order will be assigned the ID 17006, so 17005 will look like a missing order number. It's not a missing order number - 17005 has simply been used for a post instead of an order.
This means that looking at the order numbers is not a good way to track your WooCommerce orders.
What's the alternative?
The WooCommerce Sequential Order Numbers plugin fixes the problem. It allocates custom order numbers to your WooCommerce orders. These are sequential - with no gaps - as they're not used for anything else. They work by creating a dedicated 'order number' field in the database which is separate from the WordPress ID.
This simply plugin is really handy if you want your WooCommerce orders to be sequential.
29 Comments
Thanks Katie. Actually this was the only and clear article and explanation about the WooCommerce numbering system I could Google up. Taxation in Finland is strict and now I'm able to explain the case to the tax inspector if he or she hits me :) Keep up the good work! if the tax inspector hits me and asks me about the gaps between the orders.
Thanks so much, Katie.
I was fearing that I had numbers of people abandoning my order cart and I was trying to figure out why.
your blog post was very helpful in allaying my fears.
Best.
Mike
Glad it was helpful. If you're worried about abandoned carts, it's worth adding an Abandoned Cart plugin.
thank you for a very clear and concise write up on this. I appreciate that. My customer service team was concerned about this sequential number thing. Now, I have an explanation to give them.
That's great news! Yes it does seem weird at first but makes sense when you know how WordPress works behind the scenes.
Thanks Katie, was looking into exactly this issue and your post answered my question in a couple of seconds!
Fantastic! That's exactly why I wrote it, so I'm glad it helped.