Shopify inventory showing archived products

Not sure it can help, but I can across a request related to creating Related Product or Recommended Product and the search was not straight forward, with all the draft, active and archived products.

The best solution I found was to use an “advanced search” method, such as:

status:active AND title:

is all you know about your product, i.e white linen shirt, and use quote for you want only ‘white linen’ (white linen without quote will probably return white shirt as well - also use * at the end may help.

Shopify has a shirt syntax reference https://help.shopify.com/en/manual/products/searching-filtering

Whilst it is less natural that basic search, it provides great results in this use case.