Title: Whitelist plugin
Last modified: November 9, 2022

---

# Whitelist plugin

 *  Resolved [crimsonhack](https://wordpress.org/support/users/crimsonhack/)
 * (@crimsonhack)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/whitelist-plugin-2/)
 * When I activate the “LOCK AND PROTECT SYSTEM FOLDERS” function, it conflicts 
   with a plugin for viewing PDF files, displaying a 403 error instead of the file.
 * Is there any way to whitelist that specific plugin to make it work properly?
 * The plugin is called PDF.js Viewer

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [kuzmanstoyanov](https://wordpress.org/support/users/kuzmanstoyanov/)
 * (@kuzmanstoyanov)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/whitelist-plugin-2/#post-16183265)
 * Hello [@crimsonhack](https://wordpress.org/support/users/crimsonhack/),
 * The feature is adding a security rule in .htaccess in the following folders:
 * wp-content/
    wp-includes/ wp-content/uploads/
 * Depending on the folder where the file is located, there are different filters
   you can use to exclude it. They are all described under the Lock and Protect 
   System Folders section [on this page](https://wordpress.org/plugins/sg-security/).
 * In this particular case, the file which is blocked by our plugin is wp-content/
   plugins/pdfjs-viewer-shortcode/pdfjs/web/viewer.php. Here is how to whitelist
   it:
 * 1. Make sure Lock and Protect System Folders feature is disabled
    2. Add the 
   following filter in the functions.php file of the active theme:
 *     ```
       add_filter( 'sgs_whitelist_wp_content' , 'whitelist_file_in_wp_content' );
       function whitelist_file_in_wp_content( $whitelist ) {
               $whitelist[] = 'viewer.php';
               return $whitelist;
       }
       ```
   
 * 3. Activate Lock and Protect System Folders feature
 * Reactivating the feature in SiteGround Security settings will ensure that the
   list of the excluded scripts will be updated.
 * Best regards,
    Kuzman Stoyanov
 *  Thread Starter [crimsonhack](https://wordpress.org/support/users/crimsonhack/)
 * (@crimsonhack)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/whitelist-plugin-2/#post-16185683)
 * Thank you very much, it works perfectly!
 * Maybe it would be interesting to put an option to easily create whitelists from
   the interface in future updates.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Whitelist plugin’ is closed to new replies.

 * ![](https://ps.w.org/sg-security/assets/icon-256x256.gif?rev=2971855)
 * [Security Optimizer - The All-In-One Protection Plugin](https://wordpress.org/plugins/sg-security/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-security/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-security/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [crimsonhack](https://wordpress.org/support/users/crimsonhack/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/whitelist-plugin-2/#post-16185683)
 * Status: resolved