Short answer: If customers check out as guests and many don't give an email, WooCommerce's built-in order tracking won't help them, because it asks for the billing email. I built a small tracking page where the customer enters the order number and the phone number used at checkout. If both match, they see the order status and items, never the address. Each visitor gets 15 attempts per 10 minutes, so nobody can guess their way through other people's orders.
Why the default tracking didn't work
WooCommerce has an [woocommerce_order_tracking] shortcode. It asks for the order ID and the billing email. On a store where email is optional at checkout (see the Bangladesh checkout changes), many orders have no email at all. Those customers couldn't track anything, so their only option was to call or message the shop.
Asking everyone to create an account wasn't the answer either. Most buyers order once or twice a year and won't remember a password.
What every customer does have is the phone number they typed at checkout, and the order number from the thank-you page.
How the tracking page works
- A page called Track your order contains a single shortcode.
- The form has two fields: order number and phone number.
- On submit, the code loads the order by number and compares the phone numbers.
- If they match, it shows the status, a plain-language message, the items and quantities, the date and the total.
- If they don't match, it shows one generic error.
The thank-you page links to the tracking page with the order number already filled in, so the customer only has to type their phone. There's also a "Track order" link in the header and on the login page ("Ordered without an account?").
The details that make it safe
A tracking page is a small public door into your order data, so I treated it like one.
Compare phone numbers by their last 10 digits
People type the same number in different ways: 01712345678, +8801712345678, 880 1712-345678. The code strips everything except digits and compares the last 10 digits of each side:
function track_phone_key( $phone ) {
$digits = preg_replace( '/\D/', '', (string) $phone );
return strlen( $digits ) >= 10 ? substr( $digits, -10 ) : '';
}
That way a customer who typed +880 at checkout and 0 on the tracking form still matches. The comparison itself uses hash_equals(), which compares strings in constant time.
Show status, not personal data
The result shows:
- order number and status (Processing, Completed, and so on);
- a one-line explanation of that status, written for customers;
- product names and quantities;
- order date and total.
It never shows the name, address, phone or email. Even if someone did match an order, they'd learn very little.
Same error for every failure
Whether the order doesn't exist or the phone is wrong, the message is the same: "We couldn't find an order with that order number and phone number." A different message for "order not found" would tell an attacker which order numbers are real.
Full-funnel campaign management, from setup to scaling spend profitably.
Rate limiting per visitor
Order numbers are sequential, so guessing is the obvious attack. Each IP address gets 15 attempts in 10 minutes, stored as a WordPress transient:
$key = 'track_' . md5( $ip );
$tries = (int) get_transient( $key );
if ( $tries >= 15 ) {
return 'Too many attempts. Please try again in a few minutes.';
}
set_transient( $key, $tries + 1, 10 * MINUTE_IN_SECONDS );
Fifteen tries is plenty for a real customer with a typo. It makes guessing both an order number and a matching phone number impractical.
Get the real IP behind Cloudflare
This is easy to miss. When a site runs behind Cloudflare, REMOTE_ADDR is Cloudflare's server, not the visitor. Rate limiting by that IP would lump thousands of visitors together and lock everyone out at once. The code uses the CF-Connecting-IP header when it's present:
$ip = ! empty( $_SERVER['HTTP_CF_CONNECTING_IP'] )
? $_SERVER['HTTP_CF_CONNECTING_IP']
: ( $_SERVER['REMOTE_ADDR'] ?? '' );
Only trust that header if your site really sits behind Cloudflare. Otherwise anyone can send a fake one.
Keep the page out of the cache
The tracking page shows different results to different people, so it's excluded from the page cache, the same way cart and checkout are. A cached result page would show one customer's order to the next visitor.
Status messages customers understand
WooCommerce status names are written for shop staff. I added one sentence for each status:
| Status | What the customer sees |
|---|---|
| Pending payment | Your order is waiting for confirmation. |
| Processing | We have received your order and are getting it ready for delivery. |
| On hold | We are checking your payment. We will start preparing your order once it is confirmed. |
| Completed | Your order has been completed. Thank you for shopping with us! |
| Cancelled | This order was cancelled. |
These lines answer "what happens next?", which is the real question behind most "where is my order?" messages.
Results
The page doesn't need accounts, works for orders without an email, and shows nothing private. Because the link sits on the confirmation page and in the header, customers can check their order themselves instead of having to message the shop.
FAQ
Can customers track a WooCommerce order without an account?
Yes. WooCommerce's built-in tracking form uses the order ID and billing email. If your customers don't always give an email, a custom form that checks the order number against the billing phone works better.
Is it safe to look up orders by phone number?
It is, if you show only the status and items, use one generic error message, compare numbers safely, and rate-limit attempts per visitor. Never show the address or other personal details on a public lookup page.
Why does my rate limit block everyone behind Cloudflare?
Behind Cloudflare, REMOTE_ADDR is a Cloudflare server IP shared by many visitors. Use the CF-Connecting-IP header for the real visitor IP, and only when your site actually runs behind Cloudflare.
Should the order tracking page be cached?
No. It shows different results to different visitors. Exclude it from your page cache, like the cart, checkout and account pages.
Built for a live Bangladeshi stationery e-commerce store with mostly guest checkouts. If your customers keep messaging you about order status, my web development service can set this up for your shop.
Clean, accurate tracking infrastructure that reports numbers you can trust.

