I have found that password protection with .htaccess & .htpasswd files is the only way to protect any WordPress file.

I wanted to make few of my media files accessible by specific username and their password. To do this I did not find any specific WordPress plugin.

I am thinking to design a WordPress plugin to password protect any media file in the following way:

  1. When user go to 'Media' and opens a file, then there will a option to protect the file
  2. On clicking I will ask username and password to protect file and my plugin script will make the respective entries in .htaccess & .htpasswd files

I want to know, should I go for this task of new plugin or do you already know any other plugin with this functionality.

  • If someone wants to open it, he can and will. Welcome to the Internet. – flomei Feb 4 '16 at 18:59
  • Hello @user1719322 - Welcome to the WordPress Development community! Could you clarify your question a little further? Where would you like users to enter such a password, and how would you like to store/update that password? What have you tried thus far? Check out the "How to Ask" page in our help center for more tips on writing good questions. – bosco Feb 4 '16 at 20:41
  • That said, it seems like basic .htpasswd/.htaccess authentication would fulfill your needs. – bosco Feb 4 '16 at 20:44
  • @bosco solution article suggested by you great. What do you think is there any plugin, that can help to do this easily. – user1719322 Feb 5 '16 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.