Searching this Stack, I can see two possible solutions for this question (not tested).
One
The answer is not fully developed, but can provide some insight.
Restricting access to files within a specific folder
Two
How to Protect Uploads, if User is not Logged In?
Frank Bueltge’s answer seems interesting but the code is quite complex. As he himself admits his english is nasty, but I can assure his coding skills are superb 🙂
And the answer provided by hakre could be operational:
- Protecting one or more folders inside
/wp-content/uploads/through.htaccessas detailed there. - Moving the desired files to this upload folders according to User or Post-ID, and for that the answer I provide to this question should do it. And, with the examples provided, maybe you can think of other kind of filtering.
Related Posts:
- What security concerns should I have when setting FS_METHOD to “direct” in wp-config?
- What Are Security Best Practices for WordPress Plugins and Themes? [closed]
- Are WordPress Plugins essential?
- I found this in a plugin. What does it do? is it dangerous?
- What are the common security flaws I need to look for? [closed]
- What could a hacker do with my wp-config.php
- Why “Contact Form 7” doesn’t update PHPmailer library?
- Secure WordPress paid plugin
- Does WordPress contain “default” anti-SQL injection code that responds with a 404 error?
- What does a security risk in a plugin look like?
- WordPress Capabilities: edit_user vs edit_users
- How to check plugins for malicious code?
- How to properly secure my WordPress installation?
- Where should my plugin POST to?
- Security error WP 4.0 + WP phpBB Bridge [closed]
- Why am I sometimes getting a 404 error when I try to update a page with Elementor?
- Should I use RIPS tool to test my themes and plugins?
- Why users disable the WordPress update?
- How many security plugins are too many? [closed]
- Will WordPress username displayed somewhere in the site?
- Upgrading WordPress 4.0 asks for FTP password
- Is revealing just the AUTH_KEY a security issue?
- How Restrict access to admin dashboard by specific static ip?
- Protecting against malicious code in WordPress plugin updates
- Questions about brute force attacks on the admin username, coming from amazon IP addresses
- Why Better WP security plugin returns 418 I’m a Teapot “error”?
- How to expire all wordpress user passwords instantly?
- How to limit WordPress pages during updates?
- rms_unique_wp_mu_pl_fl_nm.php
- Security issues with WP sites
- Security checking in meta_box save is reluctant?
- Should you escape hardcoded URLs?
- Preventing BFA in WordPress without using a plugin
- How To Clean The Malware Infected & Hacked WordPress Websites? [duplicate]
- How to delete Passwrd Protected posts cookies when a user logged out from the site
- The safest way to automate WordPress backups
- wp_create_nonce function doesn’t work inside a plugin?
- Does WordPress validate inputs to all functions? (such as get_user_meta and insert_user_meta)
- Upgraded to latest version – 3.0.3 and Now I get a “sufficient permissions to access this page” error
- Headers Content-Security-Policy CSP Major Issue
- How to block plugin activations with no known user or coming from unknown IP address range?
- Nonce failing on form submission
- Check for security updates
- Standard Fail2Ban vs. WP Fail2ban vs. WP Fail2Ban Redux
- Malicious File Upload [closed]
- Malware installation during plugin update?
- Hack-Proof OR Security in WordPress — is it real?
- I should enable automatic updates?
- Can some vulnerabilities in plugins be exploited even when the plugin is inactive?
- Security and Must Use Plugins
- Is Timthumb still broken? What security measures should be taken?
- Is it safe to use admin-ajax.php in the frontend?
- How to protect WordPress from security scanner [closed]
- Specific way to allow WordPress users to view their current password? And edit it?
- Too many login attempts
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Website show Google Ads when we have no Google Ads linked to our website
- Vulnerability Concern From the Plugin or From Not Updating the Plugin?
- Chrome Dev Tools console says every page in my blog has link to http://maps.google.com [closed]
- Webservice credential storage [duplicate]
- Regarding plugin security
- How do I determine if the user who registered is not spam?
- If I use an alternative login (e.g. CAS or other SSO) plugin, is my site protected from the recent brute force login attempts?
- Is this plugin safe to run?
- Is the Block Bad Queries Plugin Still Relevant?
- WP Insert Post If user refreshes override new post
- 404 errors when updating options in admin dashboard
- Website Captcha Error: The reCAPTCHA wasn’t entered correctly
- WordPress search shows protected content
- Can I disable xml-rpc by setting it to false?
- How can I disable new plugin and theme install, but allow updates?
- Help to Create a Simple Plugin to make a post
- Validating ajax search
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- WordPress disable direct access of files in WordPress installation path
- Asking help regarding potential malware
- Bing/msn bots is heavily requesting random of my website
- “Fire Secure” menu item
- https rewrite not working for All in one security Brute force > rename login url
- Redux framework somehow added to my site, can’t locate in plugins
- Being hacked. Is there a list of WordPress security holes I can check against?
- wp_verify_nonce fails always
- Write mysql credentials in plugin
- Validating values using Settings API?
- SWF in wordpress post
- Unwanted Links and Spam WordPress Pages and Posts
- Problem with permissions in wp-content/plugins
- File permissions for wp-minify plugin
- What is the recommended way to be notified of security updates to my plugins? [closed]
- My WP site and password was hacked, what to do? [closed]
- How to resolve these findings from security audit
- How I can hide my wp folders from Inspect Element (Developer Tools)
- How to Find WordPress site has backdoor login Codes
- How to rename files during upload to a random string?
- WordPress User Registration/ Sign Up -> Able to take Paid Certification Courses & keep track of Completed Certificates
- Block Root REST API Route using custom &/or iThemes
- Is it a good idea to restrict the REST API
- WordPress.Security.NonceVerification.Recommended
- Secure way to add JS Script to WordPress filesystem
- How to verify/test that a custom built wordpress theme is as secure as possible?