WP Manifestindependent plugin directory
manifest / security / disable-right-click-content-protection

Disable Right Click & Content Protection

Disable right click, text selection, copy, and image dragging on WordPress to deter casual content copying, without breaking forms or keyboard navigation.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/bealinawaz/disable-right-click-content-protection/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Deter casual copying on a WordPress site: disable right click, text selection, copy and cut, image dragging, and common shortcuts, each with its own switch. Forms, keyboard navigation, and screen readers keep working, and administrators and editors are excluded by default.

Honest limits: this deters casual copying only. It cannot stop anyone who views the page source, disables JavaScript, uses browser menus or developer tools, or takes a screenshot.

Features

  • Right click: disabled everywhere or on images and videos only.
  • Text selection: user-select: none on page content plus a selectstart blocker; inputs, textareas, selects, and contenteditable areas stay selectable.
  • Copy and cut: blocked outside form fields. Paste is never blocked.
  • Images: no dragging, no iOS long-press callout.
  • Shortcuts: Ctrl/Cmd + C, X, A (outside form fields), S, U, P. Optional F12 and developer tools shortcuts.
  • Accessible notice: optional toast in a role="status" live region instead of alert(); respects prefers-reduced-motion.
  • Never blocked: Tab, arrow keys, Enter, Escape, and other navigation keys.
  • Exclusions: user roles (administrators and editors by default), post types, page IDs, and a per-post "Allow copying on this page" checkbox.
  • Small and fast: vanilla JavaScript loaded in the footer only where protection applies; no jQuery.

Setup

  1. Install and activate the plugin. Protection is on for visitors right away.
  2. Adjust it under Settings → Content Protection.
  3. Test in a private window: your own role is probably excluded.

Hooks

// Turn protection off for a page template, a WooCommerce page, or any custom condition.
add_filter( 'drcp_should_protect', function ( $applies, $settings ) {
    if ( is_page_template( 'templates/press-kit.php' ) ) {
        return false;
    }
    return $applies;
}, 10, 2 );

The per-post opt-out is stored in the _drcp_allow_copy post meta (also available in the REST API for users who can edit the post).

Project structure

disable-right-click-content-protection.php  Plugin header and bootstrap
includes/class-drcp-settings.php            Settings defaults, validation, and upgrade from 1.x
includes/class-drcp-protection.php          Where protection applies, script loading, post meta
includes/class-drcp-admin.php               Settings page and per-page meta box
assets/protection.js, protection.css        Front-end protection and notice (no jQuery)
assets/admin.css                            Settings page styles
uninstall.php                               Removes settings and post meta
readme.txt                                  WordPress.org readme

Upgrading from 1.x

Version 2.0.0 replaces "Disable Right Click For WordPress". The old "Show messages" option is migrated, developer tools shortcuts stay blocked on upgraded sites as before, and the old option is deleted. Paste is no longer blocked, and images are no longer made unclickable.

Custom development

Need image watermarking, members-only content, protected downloads, or rules for specific pages and user roles? The plugin is built and maintained by Ali Nawaz, a WordPress and WooCommerce developer. Get in touch for custom work.

License

GPLv2 or later. See LICENSE.