Installation & basic setup
WooCommerce Password Protected Categories provides an easy way to password protect your product categories or mark them as private.
1. Install the plugin
Once you have purchased WooCommerce Password Protected Categories, you should receive a confirmation email which contains your license key and a download link to the plugin. If you don’t receive this email, please check your spam folder. If it’s not there, please send us a support request.
Your confirmation email also contains a link to download your purchase invoice as a PDF.
Once you have downloaded the plugin, go to your WordPress admin, then go to Plugins -> Add New -> Upload Plugin. Click Choose File and select the woocommerce-protected-categories.zip file you just downloaded. Once uploaded, click Activate.
2. Enter your license key
Once activated, go to WooCommerce -> Settings -> Products -> Password Protected Categories and enter your license key. This should be contained in the email confirmation that was sent to you after purchase. Click Save Changes to validate and store your license key. If you get an error saving your license key, please try a second time. If the error persists, please view the article on license key problems.
3. Configure the plugin settings
You will also find the settings for the plugin in WooCommerce -> Settings -> Products -> Password Protected Categories.
Show protected categories & their products in public-facing store
Tick this box if you would like your protected product categories to be visible in your public-facing WooCommerce store. This will show protected products on your main shop page, on category pages, archives and in search results. It will also show protected categories in the product categories widget. Untick this option to hide protected categories and products.
Show protected categories & their products in navigation menus
Tick this box if you would like protected categories and their products to display in navigation menus. This works for products and categories that you have added to the menu via the ‘Products’ and ‘Protect Categories’ section in Appearance -> Menus – it does not work if you have added them as ‘Custom Links’.
Please note that unticking these boxes only affects the visibility of protected categories and products for users who have not yet entered the correct password. Once a user has entered the correct password, the category will be ‘unlocked’ to them and will display on the main store page and in the menu for that user, regardless of whether these boxes are ticked.
Password Expires After
Enter a whole number of days, after which the password will expire. On entering a correct password, users will be able to access the category for the set number of days without having to re-enter a password.
Ticking this box will automatically add ‘Protected:’ or ‘Private:’ before the name of the category and its products, wherever it appears on the website. For example, if you have a password protected product category called ‘Shop’ then it will display as ‘Protected: Shop’; and if you have a private category called ‘Shop’ then it will display as ‘Private: Shop’.
The prefix will appear on the category page, shop front, menus and widgets.
Client Login Page
You can set a page which your customers or clients can use to login to a category from a central point. The page will display a login form where the user can enter a password. If they enter a correct password for any category, they will be taken to the page for that category with the products unlocked and displayed.
The plugin will look for a category that matches the password entered, and if it finds a match, it will redirect to the first category found. For this reason, it makes sense to use different passwords for each category.
Setting this option will add the
[category_login] shortcode to the page. If you wish to customise the message displayed above the form (or remove it) you can edit the page and add the “message” option to the shortcode. For example:
[category_login message="Please enter your password below:"]
You can also add this shortcode to additional pages or include it inside a text widget. Simply paste the
[category_login] shortcode where you want the login form to display.
Use this option to customise the heading that appears at the top of the protected category form, above the message and password entry box.
You can enter some text here to customise the wording that appears on the protected category form, above the password entry box. Anything that you enter here will replace the default text.
You can format the text using HTML code to add lists, images etc. as required.
The text that appears next to the password entry box.
Tick the box if you would like to use the ‘Password Label’ (see above) as a placeholder for the password entry box.
You can change the text that appears on the ‘Submit’ button for the password entry form.
If you enter a CSS class here, it will be used in the container element that surrounds the category password form. This might be useful if your relies on full-width page templates and you want to ensure the password form has a contained width.
We recommend leaving this as ‘Standard’ initially. If the password entry page doesn’t display correctly with your theme, try switching to ‘Alternate’.