Title: CSS/JS loading when logged out
Last modified: July 10, 2020

---

# CSS/JS loading when logged out

 *  Resolved [adenmantmea](https://wordpress.org/support/users/adenmantmea/)
 * (@adenmantmea)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/css-loading-when-logged-out/)
 * Working on the optimization of our site, I’m seeing the following in the head
   section for non-logged-in visits:
 * * file /wp-content/plugins/wicked-folders/css/admin.css?ver=2.17.2
    * file /wp-
   content/plugins/wicked-folders/js/admin.js?ver=2.17.2 * file /wp-content/plugins/
   wicked-folders/js/app.js?ver=2.17.2 * code block setting two vars: wickedFoldersL10n
   and wickedFoldersSettings
 * Are these needed for guest (not logged in) visits to the website? If not, is 
   there a way to stop them from loading?
    -  This topic was modified 5 years, 10 months ago by [adenmantmea](https://wordpress.org/support/users/adenmantmea/).
      Reason: update title

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

 *  Plugin Author [wickedplugins](https://wordpress.org/support/users/wickedplugins/)
 * (@wickedplugins)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/css-loading-when-logged-out/#post-13109330)
 * Hi [@adenmantmea](https://wordpress.org/support/users/adenmantmea/),
 * Generally, those files shouldn’t be needed for guest visitors. You can stop them
   from loading by using the [wp_dequeue_script](https://developer.wordpress.org/reference/functions/wp_dequeue_script/)
   and [wp_dequeue_style](https://developer.wordpress.org/reference/functions/wp_dequeue_style/)
   functions.
 * Here are the handles for the files:
 * /wp-content/plugins/wicked-folders/css/admin.css: wicked-folders-admin
    /wp-content/
   plugins/wicked-folders/js/admin.js: wicked-folders-admin /wp-content/plugins/
   wicked-folders/js/app.js: wicked-folders-app
 * Dequeuing the ‘wicked-folders-app’ script should also remove the associated inline
   code block.
 * I hope this helps. If you have questions, please let me know.
 *  Thread Starter [adenmantmea](https://wordpress.org/support/users/adenmantmea/)
 * (@adenmantmea)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/css-loading-when-logged-out/#post-13118025)
 * Thank you, it seems to be working. My only request would be: is there a way this
   could be built in to the plugin so everyone could benefit?
 * For those looking at this in the future, here is the code to remove the script
   and style files for guest visitors, added in my theme’s functions.php file. The
   number at the end is to force it towards the end of the stack to make sure it
   has been added before we try to remove it.
 *     ```
       /* Remove wicked folders scripts if not logged in */
       function wf_dequeue_files(){
           if(!is_user_logged_in()){
               wp_dequeue_script('wicked-folders-admin');
               wp_dequeue_script('wicked-folders-app');
               wp_dequeue_style('wicked-folders-admin');
           }
       }
       add_action( 'wp_enqueue_scripts', 'wf_dequeue_files', 2000 );
       ```
   
 *  Plugin Author [wickedplugins](https://wordpress.org/support/users/wickedplugins/)
 * (@wickedplugins)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/css-loading-when-logged-out/#post-13118251)
 * Hey [@adenmantmea](https://wordpress.org/support/users/adenmantmea/),
 * Thanks for sharing the code snippet that you used.
 * I like your idea of building it in and we’ll look into that (perhaps adding it
   as an option).

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

The topic ‘CSS/JS loading when logged out’ is closed to new replies.

 * ![](https://ps.w.org/wicked-folders/assets/icon-256x256.png?rev=3043757)
 * [Wicked Folders - Folder Organizer for Pages, Posts, and Custom Post Types](https://wordpress.org/plugins/wicked-folders/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wicked-folders/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wicked-folders/)
 * [Active Topics](https://wordpress.org/support/plugin/wicked-folders/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wicked-folders/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wicked-folders/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [wickedplugins](https://wordpress.org/support/users/wickedplugins/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/css-loading-when-logged-out/#post-13118251)
 * Status: resolved