WishList Member includes the ability to protect files you upload to your WordPress site. Files you add to the media section of your WordPress site can be set as protected or unprotected and you can select which membership levels can access any files you've marked as protected. This allows you to specify which members can access different protected files within your site.
—
The first step is enabling the Files option in the Content Protection > Files section in WishList Member. Once enabled, the files that have been uploaded using the WordPress media uploader will be displayed.
—
Access to these files can be set as protected or unprotected (or inherited) similar to any post or page you might protect using WishList Member.
—
File Protection General Settings
You will find general settings for File Protection by clicking the blue Settings button on the top right.
—
The Settings popup will appear with two sections.
- File Protection Ignore List. This is a list of file extensions WishList Member will ignore in regards to file protection. You can add file extensions or remove file extensions from this list. By default a list of image, CSS and JavaScript file extensions are ignored as these are typically necessary for WordPress themes, etc.
- Nginx Information. The instructions that can be followed to ensure File Protection will work with Nginx servers.
—
Set Protection and Access for Files
There are three status options that can be assigned to a file.
- Protected. The file is protected and can only be accessed by logged in members with the assigned membership level(s).
- Unprotected. The file is unprotected and can be accessed by any users.
- Inherited. The file takes on the protection status of the page or post it appears on. As an example, if the page or post the file has been added to is protected, the file will inherit that protection status.
—
You can use the Select an Action dropdown to manage the protection and access settings of your files.
The following three options are available in the Select an Action dropdown:
- Edit Content Protection Status. You can select between protected, unprotected and inherited.
- Add Level(s) to Content. Add the membership levels that have access to the selected posts, pages or custom post types.
- Remove Level(s) from Content. Remove the membership levels that do not have access to the selected posts, pages or custom post types.
—
Select the checkbox to the left of the file(s) you want to configure and select the corresponding action you want to apply to the file(s) from the Select an Action dropdown. A popup will appear for the selected action. Adjust the setting within the popup and click the provided button to apply the action. An example is provided below for each of the three options available in the Select an Action dropdown.
Edit Content Protection Status
In this example, the checkbox to the left of the “member-level-status” file is checked and Edit Content Protection Status has been selected from the Select an Action dropdown.
—
The Edit Protection Status popup appears and the protection status dropdown can he used to set the desired protection status.
—
In this case, the Unprotected status option is selected and the Update Protection button is clicked.
—
The status of the “member-level-status” file has now been updated and shows as Unprotected.
—
Add Level(s) to Content
In this example, the checkbox to the left of the “member-level-history-01” file is checked and Add Level(s) to Content has been selected from the Select an Action dropdown.
—
The Add Level(s) to Content popup appears and the membership levels dropdown can he used to add levels to the file. This will result in members with the applied membership level(s) being able to access the protected file.
—
In this case, the Platinum and Gold levels are selected and the Add Level button is clicked.
—
The Platinum and Gold levels are now added to the “member-level-history-01” file.
—
Remove Level(s) from Content
In this example, the checkbox to the left of the “member-level-history-01” file is checked and Remove Level(s) from Content has been selected from the Select an Action dropdown.
—
The Remove Level(s) from Content popup appears and the membership levels dropdown can he used to remove levels from the file. This will result in members with the removed membership level(s) not being able to access the protected file.
—
In this case, the Silver and Bronze levels are selected and the Remove Level button is clicked.
—
The Silver and Bronze levels are now removed from the “member-level-history-01” file.
—
Toggle File Status Using the Icons
You can quickly change the file protection status for a specific file by clicking the icon that appears to the left of that file. One click will toggle to the next status and so on.
- Click the Unprotected icon and the status will be changed to Protected.
- Click the Protected icon and the status will be changed to Inherited.
- Click the Inherited icon and the status will be changed to Unprotected.
—
WP Engine – Cache Exclude and Redirect Rule
If your site is hosted with WP Engine and you find the files are not being protected as expected, there are some adjustments WP Engine can make on their side.
You will just need to ask WP Engine to Not cache files with the following prefix in the file name:
protected-
Please also ask WP Engine to cache exclude ^/wp-content/uploads/? and for the redirects, put in:
source: ^/wp-content/uploads/(.*)/(.*)/protected-(.*)
This should resolve potential issues with files protected on a site hosted with WP Engine.
—
File Protection Video Tutorial
—
WishList Member also includes a Folder Protection option. More details can be found in the Folder Protection Knowledge Base entry.