• Resolved Ali

    (@alibehvand)


    In the WordPress dashboard, under the All Products section in WooCommerce,
    when I click on Sort by SKU to sort my products accordingly, there’s a problem:

    It shows in-stock products first, and out-of-stock products are pushed to the bottom.

    As a result, the sorting isn’t accurate.
    For example, instead of sorting like:
    1 - 2 - 3 - 4 - 5 - 6
    it ends up as:
    1 - 3 - 6

    Because products like 2, 4, and 5 are out of stock, they don’t show up in the correct SKU order, which breaks the expected sequence.

    Do you think there’s a setting somewhere causing this behavior?

    Or is there a way to configure it so that all products—whether in stock or out of stock—are included in the SKU sorting?

    https://example/wp-admin/edit.php?post_type=product&orderby=sku&order=asc

    The link also clearly shows that the sorting is only based on SKU,
    so it’s basically saying that nothing else is being considered.
    But then why are in-stock products listed first, and out-of-stock ones sorted afterward?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @alibehvand,

    Thanks again for the details. I tested the sorting and on my end, the products (including out-of-stock ones) were sorted correctly by SKU. So this doesn’t seem to be a default WooCommerce issue.

    To help us narrow this down, could you try the following?

    1. Temporarily switch to the Storefront theme and
    2. Disable all plugins except WooCommerce
      Then try sorting again using the same link. 

    If possible, it might be worth testing this on a staging site, where you can safely disable plugins and switch themes without affecting your live store. That way, we can isolate whether something in the current setup is affecting the SKU sorting.

    If you don’t already have a staging site, you can use a plugin like WP Staging to create one. 

    If the issue still happens, please also share your System Status Report.
    You can find it under WooCommerce → Status → Get system report, then copy the full output and paste it at https://pastebin.com or https://gist.github.com, and share the link here.

    A couple more questions to help us dig in:

    • Are you using any custom code or plugins related to stock management or admin filtering?
    • Do you notice this only when sorting in ascending order, or also in descending?

    Once we have those details, we’ll be better equipped to guide you.

    Looking forward to your update!

    Plugin Support Chris Moreira – a11n

    (@chrism245)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

    If you have a few minutes, we’d love if you could leave us a review: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problem with sorting SKUs’ is closed to new replies.