Skip to main content

Include password protected WooCommerce products in search results

How to include password protected products in WooCommerce search results for non-logged in users?
Easy, put this somewhere in functions.php:

By default password protected products are displayed only to logged in users.
Unfortunately there is no filter to override that, so this small tweak is required to show them to everybody.

Single product page is still not visible to anyone without password, only title and excerpt is visible by default to everyone.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please don’t paste any HTML, Js or PHP code into comments box, use or similar service to share code examples.

Characters left: 1000