Answer the question
In order to leave comments, you need to log in
How to block access to all site files for unregistered users in WordPress?
I describe the situation: there is a site on WordPress, access to which is limited to registered users. It may sometimes be necessary to exclude some users. But I noticed such a feature that the site files via a direct link will be available even to unregistered users. That is, from a "supposedly closed" site, people can send direct links to pictures or PDF files, and they will work.
How to avoid it? How to make sure that all files are available only to authorized users?
Answer the question
In order to leave comments, you need to log in
It is unlikely that standard means will work, you need to look for a specialized plugin.
I think that it is necessary to fasten something like this into the output function of attached files:
global $user_ID; get_currentuserinfo();
if (('' !== $user_ID) - check if user is authorized
Source
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question