Skip to content
Sign in

PTP Private Media

Protect WordPress media files with access controls, secure delivery, temporary share links, and SEO indexing protection.

Not scanned yet WordPress plugin 10 installs

Install in

No install steps yet

Follow the steps on the source page.

PTP Private Media gives you full control over who can access your WordPress media files. Stop search engines, bots, and unauthorised visitors from downloading your protected images, PDFs, videos, or documents.

Author: Umang Prajapati | WordPress Profile | GitHub

Core Features

πŸ” Real Server-Level Media Protection
* Automatically writes per-file .htaccess rules to block direct /wp-content/uploads/ access to every protected file and all its generated thumbnail sizes
* Built-in Direct File Protection Self-Test on the Dashboard verifies live whether direct access is blocked
* Public files continue to be served natively by Apache with zero PHP overhead
* Copy-paste Nginx configuration rules provided in the Dashboard

πŸ‘₯ Fine-Grained Access Control
Set a protection level for every file in the Media Library or Block Editor:

  • Public – standard WordPress behaviour
  • Logged-in users only – any authenticated user
  • Specific roles – choose from all registered WordPress roles (Admin, Editor, Subscriber, etc.)
  • Password protected – custom password per file
  • Restrict to posts/pages – only accessible when referred from specific content

πŸ”— Permanent Embedded URLs + Optional Temporary Share Links
* Embedded media in posts, pages, and blocks uses a permanent dynamic endpoint (example.com/restricted-media/{file-id}/) that never expires and checks user permissions live on every request
* Optional Temporary Share Links (example.com/restricted-media/{file-id}/{token}/) let you generate HMAC-SHA256 signed, time-limited links when sharing externally
* Hotlink protection prevents embedding on external domains
* Optional IP-address binding for temporary share tokens

🚫 SEO & Indexing Protection
* X-Robots-Tag: noindex, nofollow header on all protected file requests
* Optional Disallow entries in robots.txt for the uploads directory
* Disable and redirect WordPress media attachment pages
* wp_robots API integration for attachment pages

πŸ“‚ Seamless Media Library & Block Editor Integration
* Single, unified Protection Settings panel in the Media Library Grid popup, Block Editor sidebar, and Classic Attachment Edit screen
* Auto-saves settings when changing Access Type or Allowed Roles
* Protection status column (Protected / Public / Password / Role) in list view
* Bulk Actions: protect multiple files, change access rules, make public

⚑ Performance
* Full HTTP Range (206 Partial Content) streaming support for HTML5 video and audio seeking of any size
* Chunked streaming for large files above configurable threshold
* Object cache support with cache invalidation on settings change
* Scheduled cleanup of expired tokens and old access logs

Written by Joobi from the project's own listing. See the source page

file access controlmedia librarymedia protectionprivate mediasecure files
22 Nov 2026
Version 1.2.1 released. Not scanned yet.

1.2.1

  • Fix: Embedded protected media no longer expires after 1 hour. Protected attachments now use a permanent dynamic endpoint (/restricted-media/{id}/) that evaluates live user permissions on every request, while expiring HMAC tokens remain available as optional Temporary Share Links.
  • Fix: Direct /wp-content/uploads/ access to protected files (and all generated thumbnail sub-sizes + original unscaled images) is now genuinely blocked via per-file .htaccess RewriteRule rules synced automatically on save, bulk action, and deletion.
  • Feature: Added an automated Direct File Protection Self-Test on the Dashboard (with a one-click Re-test button) that verifies whether direct /uploads/ access returns HTTP 403 and displays exact Nginx/Apache rules if server configuration is required.
  • Fix: Media Library Grid popup (upload.php?item=ID) now properly displays the Protection Settings panel by extending wp.media.view.Attachment.Details.TwoColumn in addition to Attachment.Details.
  • Fix: Eliminated duplicate Protection Settings panels in the Block Editor / Media Modal sidebar by removing the redundant .compat-field-urma_protection row once the JS panel mounts.
  • Fix: Fixed cropped Generate button and hidden Copy button in narrow Media Modal sidebars by using a responsive stacked layout inside .urma-secure-url-section.
  • Fix: Editing Access Type or Allowed Roles in the Block Editor now auto-saves and updates the Backbone attachment model URL live without breaking embedded Video/Image blocks.
  • Fix: Enabled HTTP Range (206 Partial Content) support whenever a Range header is sent, ensuring HTML5 <video> and <audio> playback and seeking work reliably for files of any size.
  • Fix: Preserved existing password hash when updating a password-protected attachment with a blank password field.
  • Fix: Default Protection setting (urma_default_protection) is now automatically applied to newly uploaded attachments.

1.2.0

  • Compatibility: Tested with WordPress 7.1.4 and PHP 8.4.
  • Fix: Multi-role protection settings were silently dropped to a single role when saving from the Attachment Details dialog (media modal grid view).
  • Fix: Protection settings edited in the Block editor β€œOpen Media Library” panel were never saved.
  • Fix: Block editor media panel did not pre-populate the current role selections when re-opening an attachment.
  • Fix: Secure URL section (Generate / Copy / Revoke) was missing from the media modal popup and Block editor media sidebar.
  • Fix: Rate limit on the secure URL generation AJAX endpoint raised from 30 to 120 requests per minute.

1.1.0

  • Compatibility: Requires PHP 8.0+ and WordPress 6.1+.
  • Fix: Access log retention cron now auto-purges logs based on retention period.
  • Fix: Password form POST now verifies the nonce before processing.
  • Security: Session identifiers for anonymous password access use random_bytes(16).

1.0.0

  • Initial release.
18 Jun 2026Listed on Joobi from WordPress.org.

Follow this listing's changes (Atom feed)