How to Restrict Public Access to File Links?

[ad_1]

Hello, is there a way to restrict to any files uploaded to a certain folder on `/wp-content/uploads/example-folder`

For example, on the frontend. Registered user upload a file, and it’s stored as `/wp-content/uploads/example-folder/file.png`

Hence, if someone has the link to it, anybody can access the file the registered user uploaded.

`example.com/wp-content/uploads/example-folder/file.png`

Is it possible to:

* Only a logged-in admin and the logged-in user who uploaded the file can access the file via its link.
* And
* Other logged-in registered users or unregistered guest will not be able to access the file even if they have the URL to the file.

The goal is to ensure only those who has permission to access to the uploaded file can access it and nobody else.

[ad_2]

 

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