You cannot at the same time allow access to file (via embedding) and disallow access to file. That’s just not practical and you waste your time on holes.
The comment is quite right that you would need to stream file from protected location for working access control. Even then if client-side viewer has access to it then it’s a non-issue to get the file itself out.
Note that WordPress core is completely engineered to reside in web–accessible location. Splitting some of the media from that and implementing streaming that a quick and trivial customization.
Related Posts:
- How to restrict a page [without plugin]
- Restrict access to specific users
- How do we restrict a user to see a field in a post without registration,
- Hide posts of particular category for everyone except of particular user group or role
- How restrict video to be open on direct url hit
- Disable Page if user not logged in
- Learndash groups content protection with tags
- How can i restrict a page to certain user roles?
- Segregating content in a blog for 2 different readers
- Restrict directory listing to only logged in users
- Restrict content even to specific user
- Member Site – Always Sends Me Back To Login
- I want to restrict a page for subscriber and contributor
- How to stop EU users from accessing my website?
- How to restrict attachment download to a specific user?
- simple solution for restricting access to (some) uploads/downloads
- Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts
- User redirect to destination URL after login
- Create a USERNAME and PASSWORD protected WordPress page
- Loading posts associated only to the logged in user on recent posts page
- Does pre_get_posts affect REST API responses?
- Restrict post edit/delete based on user ID and custom field
- How do I display a user specific content?
- How can I limit functionality in one version of a plugin?
- Hiding posts from non logged in users
- Restrict access to post if it is currently being edited
- how to make author to write comment on only his own posts?
- setting a specific home page for logged in users
- Restrict the user access in multi site for non-assigned blogs
- Restrict access to the Trash folder in Posts
- Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end
- Restrict certain posts from being sent to the feed subscribers
- Removing WordPress Plugin Menu Item for a specific user
- Allow access on a page to just only a specific member
- Restrict PDF links
- Limit REST API output to current logged in user that is also author of the content
- WordPress stripping html and script tags from some admin users on save
- Taxonomies, restrict editing and creation of terms?
- Hide everything on site for visitors except specific page IDs
- Restrict Login Subscriber users from accessing frontend
- Restrict other Admins from using Editor in Admin Panel
- How to restrict the editors from viewing/editing pages created by admin?
- Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution
- Redirect user to login before viewing custom post
- not logged in users can’t submit form
- Is it possible to restrict viewing of category PAGE to logged in users only?
- Page Restriction and Redirect for Particular Levels or user
- Protect sequence of pages with same password for each of two groups of users
- How can I restrict image upload dimensions for non-admin WordPress users?
- How to restrict logged user to view only certain pages?
- Limit post display to post authors and create an exception for specific pages
- Use an activation code to change a role [closed]
- Restrict certain character combinations in username during registration
- How to show post content before read more tag (excerpt) for password protected posts?
- How do I log out users from a restricted page if they are already logged in on another device? [closed]
- Are exclusive taxonomy terms possible?
- Restrict access to content in conjunction with facebook connect & google login
- Remove admin menu
- I restricted wordpress by logged users. It’s possible exclude a page?
- Limit file downloads to logged in users (WP + Nginx)
- How to properly print a 404 error without redirecton? (i.e. keeping the current URL)
- How to allow registered users to submit the form only 5 times per day?
- Get a remote post ID via API given URL
- Restrict content based on buy woocommerce product
- User restricted only show posts assigned to current user
- How to force acceptance of site terms on first login?
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- Restricting page access [closed]
- Restrict access to trash, only admin
- Downloadable content only for subscribers?
- Hide front-end from every logged out user and redirect them to the default login page
- Restrict the list of parent pages to only those which are created by current user
- How to restrict an admin page, if the user is not superadmin?
- Should I setup frontend-only users as CPT or use a plug-in?
- How to restrict access to a single for users I’ve authorized? [closed]
- Is it possible to restrict access to specific pages in the admin area based on the page slug?
- Requiring login for specific pages
- How can I lock specific posts (cpt’s) from editing by anyone other than ADMINS
- How can I set a maximum allowed post size and number of posts submitted?
- How can I restrict a custom WordPress role access to only a specific plugin?
- Is it possible to restrict files from your wordpress uploads (not logged-in users or guest)?
- Custom content before post content
- Require re-login when logged-in user attempts to access restricted page
- force login loophole
- Simple Math Quiz or Captcha to hide whois query form
- How to restrict a plugin from certain pages without editing its core
- Prevent certain subscribers from seeing specific taxonomies (changes frequently)
- Is there a way to create folders restricted to specific users to open?
- Show/hide posts and categories based on user meta
- Uploading attachment (pdf) and prevent download for anonymous user
- Show content if user left comment / non-logged visitors?
- can you help review CCCP (Conditional Cookie Content Post) and help to create a block?
- create a custom query for posts managed by Restrict Content Pro
- Limit users to specific uploads
- URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site
- After reading 3 story by user ask for subscription popup
- How can I fetch user registration age
- Restrict access if logged out except for homepage
- How to show private pages based on a user’s role?
- How to block access to a folder inside of wp-content for non logged in users?