My name is Ava, I’m one of Shopify’s Gurus and I’m here to help :)
At the moment, there is no way to exclude certain products from a discount code I’m afraid. Discount codes can be applied to several products/collections, or to a customer's entire order. (Take a look at this guide on how discounts can be applied here!)
However, you can use this workaround to exclude certain products from a discount code! You can create a hidden collection and add all your products to it, but *exclude* the products you would like to exclude from the discount code. Then, you can apply the discount code to that collection! So you would be excluding the products from the collection, then applying the discount to that collection.
It would be faster for you to create a manual collection if you have a lot of products in stock. There is a guide here on creating a collection.
Alternatively, you can take a look at some of these Bulk Discount apps here. They will help you manage your discount codes! Would any of those option work for you?
Allowing for a more streamlined way to apply discount codes is something our development team is actively working on. So hopefully, there will be an easier and more efficient way to do this in the future!
Let me know if you have any more questions, happy to help :)
Social Care Guru | email@example.com