Woocommerce shop page empty with the result count 1 product randomly

Last week, my customers report a weird bug that the Shop page of Woocommerce is blank / empty. It appeared randomly, and it’s fixed when I re-save the permalink.

When researching some related issue, I found that on WPML forum (because the site I’m working with has WPML also), there are some users reported about this bug. According to this guy, the bug is fixed when he disabled the Yoast SEO plugin. I tried and it works, but the main point is I can’t deactivate Yoast SEO since it’s related to my theme breadcrumbs and other SEO settings, so the journey began here.

I’ve worked with many Woocommerce sites and this is the first site has the weird bug like this. I tried to compare all the different things between this site and the others.

I didn’t remember why I’ve setup the permalink for this site is different from the others, but it’s the key settings that cause this bug.

I used the same slug for both Shop page and product detail page, because in Vietnamese, “products” and “product” has the same slug “san-pham” (there is no differences between the singular and plural noun). That’s why shop page only displayed 1 product in the result count, it’s for the product detail query.

After updating the shop page slug, this issue is fixed (I’ve kept checking this issue for some days to make sure that it’s fixed). The most important lesson I’ve learnt is “Don’t use the same slug for shop page and product detail“.