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
- 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 can I limit functionality in one version of a plugin?
- 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 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
- Limit REST API output to current logged in user that is also author of the content
- 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
- 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
- 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
- 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 access to trash, only admin
- Downloadable content only for subscribers?
- 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?
- 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
- 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
- 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?
- Hide top admin panel for non admin and non editors
- WordPress Front-End user restricted taxonomies
- How to use url formatter with integer
- Restricted images only for logged user. (hidden url)
- Multiple domains, Single database, 1 Parent/Master with all content, other domains/slaves with filtered content (based on “location” variable)
- Using a page-template to restrict access based on IP (Frontend)
- Restrict access to custom post type and filter from every query
- Allow users to only CREATE one single (custom) post
- Front end login and page restriction
- WordPress Shop and restricting products and categories for some users/groups
- Assign specific editor with custom user meta “A” to all authors with custom user meta “A” and exclude all other author access
- How to give members access to their own protected page?
- Restrict access to specific content
- Restrict download files from not generated Urls
- Avoid too long words in a post title, post content or comment but only if its not a url
- Basic File/Post restriction plugin
- How can visitors redirect wp-admin to the homepage?
- Website visible only to Registered users (non wp-admin)
- Valid WordPress html elements
- Multisite Login Access Restrictions
- Restrict Image Sizes and Dimensions when Uploading via the WP Mobile App