This isn’t really a WordPress question – but you can add a rewrite rule to prevent access unless the referrer is your own domain.
[Update]
You’ll need to do 2 things
-
Add a rewrite rule (either directly with .htaccess or by using WP_rewrite (Codex reference). The aim here is to deny requests to your documents that don’t have your domain as a referrer – this stops people pasting the link into a browser’s address bar
-
Wrap your download links in an
is_user_logged_in
(Codex reference) conditional block – that way they will only show up on the page if the user is logged in
A code example is available in a related question:
Related Posts:
- Restrict access of admin uploads to certain logged-in users?
- How to programatically change username (user_login)?
- Allowing users to edit only their page and nobody else’s
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- Hide Admin Menu for Specific User ID who has administrator Role
- How to hide media uploads by other users in the Media menu?
- Allowing an email as the username?
- Check if specific username is logged in
- Post list based on the user that is logged in
- Basic auth WordPress REST API dilemma
- Copy a user from one WordPress site to another
- User File Upload Repository?
- Front end user meta options for users
- add ‘file upload’ field to user details
- How to customize wp_signon()
- Can I create users that have access to *some* other users posts instead of all other users posts?
- Set default page for user account in admin
- Share user table from WP with Drupal
- Log all users out of all locations after 24 hours
- Hide everything on site for visitors except specific page IDs
- Managing Users and Creating Groups [closed]
- show text If special user is logged
- How to delete all post and attachments of a user when I delete it?
- Upgrade Nightmare – No Posts, Permissions Issues and Can’t Create a new post
- How to disable a specific page for a specific user
- How to protect post attachments related to a custom post type, from non-logged in users, on 1 subsite of a multisite installation?
- Allow user access to Dashboard only!
- wordpress user roles are not working
- Displaying different in-page content to cliente/admin
- Problem with automatic role change through cron job
- Reset Password policy
- How can I allow an User to publish only 5 posts per month?
- Where are $current_user->allcaps set?
- How do you manage your pages or functions that require logged-in users?
- Allow admins to login as other users
- Can I Create a Second Admin Level User Role?
- Delete a user from frontend
- Unique password to access a section site
- One Click Access To Users Account In WordPress?
- Using my own user table
- Allow users to upload flash videos?
- WordPress user role with create user capability?
- Update user role for expired membership
- How do I set a maximum upload size for a specific user role (Editor)
- Front-end uploader logging user out when they attempt to upload image
- How to use url formatter with integer
- Custom User Role: Can Edit Own Page, Cannot Create New
- WordPress install checking permissions of user id 0
- throttle/limit a logged in user’s http requests to specific page on a per day basis
- Allowing users to edit only their page and nobody else’s
- How to bulk change user role to “No role for this site”
- Restrict Access to the User Profile
- post acces for guests / unregistered users only
- Username has been exposed
- view and update form only for registered users
- Control Category of each user can post
- Limit user access to installing/configuring a plugin?
- determine active user browser at the same time
- MySQL query to list users who never signed in
- Wordpres password as plain text in email
- WordPress password as plain text in email
- how to use joomla password format in wordpress?
- How to do get_users() with multiple meta_keys
- Saving Custom Field in Attachment Window in WordPress 3.5
- Force users to complete their profile after they register? How to
- Limit content by user registration date
- What is the best way to avoid spammers registering to my blog?
- Completely hide user info
- Prevent Admin user to edit/see super admin from users list
- the_author_meta(‘user_url’, $author->ID) not working properly. how can I solve this?
- Order users by last word of last name
- Remove user profile field [duplicate]
- Fatal error: Call to undefined function get_users()
- Does an AJAX call on the Admin Side Automatically include the User Data/Capabilities?
- WP_User_List -> How to open a new edit-page in WordPress admin backend!
- Log out users from every where
- No user found when using REST API
- is_user_logged_in() throwing undefined function error
- How to prevent a specific users’s profile photo (gravatar) from showing on the frontend to other users?
- How many people are allowed to use same wordpress account at the same time?
- Show only the first 300 words / 50 lines of blog posts for non registered users
- Front-End User Profile
- WordPress Redirect Specific User. Tired of Peter’s redirect Plugin its not working
- WP_Query: attachment image in “full” size?
- How to allow access based on the user meta flag
- Authentication between two different sites using the WordPress login cookie
- How can I display Only the first Array/Object?
- How can i add user display name drop down menu in frontend?
- Return all users that have one or more published blog posts
- Updating the attachment from front end doesn’t show the new change
- Modify the user data stdObject and add extra items to it?
- wp_update_user() returning http 500 internal server error
- Change “logged in as a ” link in comments form
- Specific Content on pages based on user
- force registered user as seller
- Manage user profiles with WordPress
- Not able to call value in the core files
- Fetching posts that match a User Profile setting
- how can i inform other users about new user registration? [closed]
- How to display Most Recently Read 10 Posts by a logged in user in wordpress