Prevent access to PDF & DOCX files for all non-admin users?

[ad_1]

I have tried Prevent Direct Access plugin it didn't work; whenever i visit a url like this: {LINK}/wp-content/uploads/2024/09/{FILE}.docx
it still opens the file. I just want to show 403 or redirect.

[ad_2]
2 Comments
  1. To expound on my previous comment, you would need something between the user and the file – a script which checks whether the user has permission to access the file, or not. By the looks of it, this is what the Prevent Direct Access plugin does – “Once a WordPress file is protected, Prevent Direct Access will automatically generate a private download link containing a random string for you to access or share this private file with others.”

    You would need to use the private download links that the Prevent Direct Access plugin generates, using the wp-content/uploads link is no good.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer