How to secure Plugin files to prevent direct access

A lot of WordPress Plugins allow direct access by typing in the url in your browser. Depending on the situation, this could be a potential security threat that could allow your site to be hacked. Today’s snack will show you how to stop people from being able to access your Plugin files directly.

Just enter this code below into your .htaccess file. Remember to back up your .htaccess file before you edit it.

<Files ~ ".(js|css)$">
  order allow,deny
  allow from all

We obviously can’t guarantee this will help prevent your site from being hacked, but it could help.

   Related Sponsored Links

Disclaimer: The information contained in this website is for general information purposes only and in no event will this site or its owners be liable for any losses or damages associated with your use of our site or content. Click here to see our full Disclaimer.

Leave a Comment