Once again, the solution “gets” the list of products IDs that are in stock, and then passes the result to the official [products] WooCommerce shortcode, so that we don’t reinvent the wheel.
You can then use the [in_stock_products] shortcode anywhere you wish – on a blog post, in a custom page, in a widget, and so on. You can even customize the output with the official WooCommerce [products] shortcode parameters such as columns, orderby, limit, etc. Enjoy!
On this custom WordPress page, the [in_stock_products] shortcode outputs the list of… in stock products!
PHP Snippet: Shortcode to Display WooCommerce In Stock Products Only