Reply To: Hiding unpublished items


Ernest Marcinko

Hi again!

Indeed, something is not right. I’ve digged more into the problem, and it appears to be a recently discovered WooCommerce bug, whereas trashing a product, will not trash product variations – they stay published in the database. Here is the issue #12774, and apparently they are fixing it within the 4.7 release: fix #12798

However I was able to create a temporary workaround. Just add this code to the functions.php file in your active theme directory:

This will check for orphan variations within the results, and delete them before the output.

Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)