Init Content Protector – Anti-Copy, Anti-Scrape, Encrypt-All
Protect your content from copying, scraping, and inspection using JS blocking, keyword cloaking, noise injection, and optional full encryption.
Install in
Init Content Protector is a powerful yet lightweight plugin that safeguards your post content from unauthorized copying, scraping tools, and inspection via browser developer tools.
This plugin is part of the Init Plugin Suite — a collection of minimalist, fast, and developer-focused tools for WordPress.
GitHub repository: https://github.com/brokensmile2103/init-content-protector
Features:
– JavaScript-based copy protection (blocks selection, right-click, print, DevTools access)
– Advanced DevTools blocking (optional, powered by the third-party disable-devtool library) — detects DevTools being opened through multiple methods, not just keyboard shortcuts, and closes or redirects away from the tab
– Anti-screenshot / anti-scraping-tool detection (optional, powered by “Init AntiSnap 6.0”) — recognizes the evenly spaced, step-by-step scrolling of scroll-and-stitch capture tools and DevTools full-size captures, and briefly blurs the page with a warning
– Full AES-256 content encryption with client-side decryption via the browser’s built-in Web Crypto API (CryptoJS is only loaded on sites not served over HTTPS, or on demand as a fallback)
– Inline delivery (default, simple) or Enhanced delivery (fetches the key via a REST API endpoint after page load — keeps it out of cached/static HTML, cache-plugin friendly)
– Encryption is done fresh on every request (about a third of a millisecond), so members-only or per-user content can never be served to the wrong visitor from a cache
– Fails open gracefully on hosts missing OpenSSL/PBKDF2 support, instead of breaking the page
– Optional Headless Browser Detection: withholds decryption from sessions that look like Puppeteer/Playwright/Selenium, scored across several client-side automation signals so no single false-positive blocks a real visitor; verified search engine crawlers (Googlebot, Bingbot…) are let through by reverse DNS check
– Keyword cloaking using CSS pseudo-elements (whole words only, Unicode aware, never inside HTML attributes or code blocks)
– Invisible noise injection to confuse crawlers — class names are generated for each post and rotate daily, the hiding rules are printed in the page itself, and look-alike decoy elements wrap some real words, so noise cannot be stripped with a fixed list; only ever injected into plain text, never inside HTML tags or inside <script>, <style>, <pre>, <select>, <svg>, and similar elements; injection rate is configurable (1–50%)
– Automatic AMP detection — protection is skipped on AMP endpoints instead of producing invalid markup
– Per-post type configuration, protecting either every post of those types or only the posts you switch on (editor box and bulk actions)
– Excluded user roles (protection never applies to selected roles)
– Custom encryption key per site
– Custom content selector support, with an Auto-detect button in settings
Use this plugin to harden your site’s content visibility while maintaining a smooth reading experience for real users. Its goal is to deter casual bots and crawlers — not to stop a determined human, since anyone who can see content can always screenshot or retype it.
Source Code
This plugin decrypts content with the browser’s built-in Web Crypto API. CryptoJS is bundled only as a fallback for sites not served over HTTPS or browsers without Web Crypto.
– Minified version: assets/js/crypto-js.min.js
– Source version: GitHub Repo
This plugin optionally uses disable-devtool (MIT licensed) for the “Enable Advanced DevTools Blocking” setting.
– Minified version: assets/js/disable-devtool.min.js
– Source version: GitHub Repo
This plugin optionally uses “Init AntiSnap 6.0” by Init HTML (MIT licensed) for the “Enable Anti-Screenshot Protection” setting.
– Vendored as its full, human-readable source (not minified): assets/js/init-antisnap.js
License
This plugin is licensed under the GPLv2 or later.
You are free to use, modify, and distribute it under the same license.
Written by Joobi from the project's own listing. See the source page
1.10 – November 20, 2026
- New: Protection Scope setting. Choose Only posts where protection is turned on to protect nothing by default and switch protection on per post, with a Content Protection box in the post editor (classic and block editor) for the selected post types, Turn content protection on / off bulk actions and a lock column on the post list. In this mode JavaScript Content Protection, Advanced DevTools Blocking and Anti-Screenshot Protection also only load on protected posts. The default scope, all posts of the selected post types, works exactly as before.
- New: noise injection no longer uses a fixed list of class names. Every protected post gets its own generated class names that rotate daily and look like ordinary theme classes, and the rules that hide them are printed inline in the page (mixed selector forms, shuffled with harmless rules). Visible look-alike elements now wrap some real words, and noise elements carry the same decoy classes, so scrapers can no longer strip noise with a fixed list or by removing unknown elements. More element types are used for noise, and the
aria-hiddenattribute that made noise easy to spot was removed (noise isdisplay: none, which already hides it from screen readers). Readers see exactly the same text as before. - New: dark mode for the loading skeleton and the “enable JavaScript” notice. New setting Loading Skeleton Color Scheme (Light, Dark, or Automatic following the visitor’s system setting). Every color is now a CSS custom property (
--icp-skeleton-bg,--icp-skeleton-shine,--icp-noscript-bg…) that themes can set on.icp-protectedfor their own dark mode switch, and the newinit_plugin_suite_content_protector_skeleton_schemefilter picks the scheme in PHP. - The stylesheet
style.cssis now only loaded in Encrypt mode (loading skeleton), and the old fixed noise class rules were removed from it (about 100 selectors). Purge your page/CDN cache after updating so no page built by 1.9 is still served. - Fixed: automatic excerpts and SEO meta descriptions built from the post content showed the “Please enable JavaScript” notice in Encrypt mode, or contained the hidden noise words and lost cloaked keywords. Protection is now skipped when the content is run for an excerpt or inside
<head>; the article body is protected as before. New filter:init_plugin_suite_content_protector_skip_secondary_content. - Fixed (1.9): Enhanced key delivery could refuse a verified search engine crawler that rendered a cached page with an expired nonce, leaving it on the loading skeleton. A crawler verified by reverse DNS is now accepted too.
- Fixed (1.9): without a persistent object cache, failed crawler checks were not remembered, so a bot sending a fake Googlebot User-Agent made the server repeat slow DNS lookups on every request. Failures are now remembered for 10 minutes in a single size-capped transient (one database row at most).
- Fixed (1.9): an invalid IP range added through the
init_plugin_suite_content_protector_cloudflare_rangesfilter printed PHP warnings on every request. - Fixed: saving the settings removed backslashes from the encryption key, keywords and content selector (the values were unslashed twice).
- Fixed (1.9): several files had mixed line endings; every file now uses CRLF.
- Performance: settings, keyword lists and keyword matchers are memoized per request instead of being rebuilt for every enqueue callback and every content call.
- New filters:
init_plugin_suite_content_protector_is_protected_post,init_plugin_suite_content_protector_noise_rotation,init_plugin_suite_content_protector_skip_secondary_content,init_plugin_suite_content_protector_skeleton_scheme. - Uninstall also removes the per-post switches and the failed crawler check list.
- Updated Vietnamese translation.
1.9 – November 18, 2026
- Fixed: Headless Browser Detection blocked Googlebot. Googlebot renders pages with a headless Chromium, so it scored as automation, never got the decrypted content and only saw the loading skeleton (visible in Google Search Console and the Rich Results Test). New option Allow Verified Search Engine Crawlers (on by default, also for existing sites) lets real crawlers through.
- Crawlers are verified with a forward-confirmed reverse DNS lookup, the method Google and Bing document, never by User-Agent alone, so scrapers pretending to be Googlebot are still blocked. Supported: Google, Bing, Apple, Yandex, Baidu.
googleusercontent.com(rentable Google Cloud addresses) is deliberately not accepted. - Only a session that already scores as automation asks the server, through the new REST route
/wp-json/init-content-protector/v1/crawler. The answer is never cached, so it works behind full-page caches and CDNs. Any failure (REST blocked, timeout, invalid answer) keeps decryption withheld. - DNS lookups only run when the User-Agent claims to be a known crawler. A verified IP is remembered for a day; failed checks are kept in the object cache only, so fake crawlers from many IPs cannot bloat the options table.
- New setting Visitor IP Detection for sites behind Cloudflare or another proxy, where the server would otherwise only see the proxy’s address. Automatic (default) reads
CF-Connecting-IPonly when the connection comes from Cloudflare’s published IP ranges, andX-Forwarded-For/X-Real-IPonly when it comes from a proxy on a private network, so a visitor cannot forge them. You can also pick Direct connection, Cloudflare, or a proxy header (X-Forwarded-For,X-Real-IP,True-Client-IP,Fastly-Client-IP). The settings page shows the IP address the plugin currently sees for you. - New filters:
init_plugin_suite_content_protector_verified_crawlers,init_plugin_suite_content_protector_client_ip,init_plugin_suite_content_protector_cloudflare_ranges,init_plugin_suite_content_protector_pre_crawler_dns_check,init_plugin_suite_content_protector_is_verified_crawler. - Fixed: saving the settings without a Content Protection Mode or Key Delivery value raised PHP “undefined array key” notices.
- The FAQ about SEO now says that crawlers which run JavaScript may still not index encrypted content reliably, and to test with Search Console.
- Uninstall also removes the verified crawler transients.
1.8 – November 17, 2026
- The
init-content-decryptedJavaScript event is now documented (see the FAQ) and easier to listen for. It is dispatched on the element that now holds the content and bubbles up, so listeners on that element, ondocument(includingjQuery( document ).on()and plugins that watch DOM events on the document) and onwindowall receive it. In 1.7 it was only dispatched onwindow, whichdocumentlisteners never saw. Works the same for Inline and Enhanced (REST API) key delivery. - The event now carries
event.detail.element(the element holding the decrypted content) and the newevent.detail.postId. - The event is only fired after decryption succeeded and the content is in the page. If the placeholder was removed from the page before the content arrived, nothing is inserted and no event is fired (1.7 fired it with an empty element).
- Compatibility: other plugins and scripts that need to run on the article text (search term highlighting, table of contents, reading progress, lightboxes) can now re-run once the real content exists, without a MutationObserver.
- Removed the
Tested up toline from the plugin file header (the value is read from this readme).
1.7 – September 26, 2026
- Encrypt mode now decrypts with the browser’s built-in Web Crypto API by default — about 78x faster than CryptoJS on a long article. CryptoJS is only loaded on sites not served over HTTPS, or on demand when Web Crypto is unavailable or fails. New filter:
init_plugin_suite_content_protector_load_cryptojs. - Removed the per-post transient cache of encrypted content. It could serve members-only or per-user content to the wrong visitor, went stale after changing settings, and cost two database queries per view. Encryption is now done per request (about 0.3 ms thanks to a memoized key). Leftover transients are removed on uninstall.
- Fixed: if a theme or plugin called
the_contentearly (SEO meta, excerpts), the encrypted payload could be printed there and never reach the real content area. - Fixed: Enhanced key delivery failed on fully cached pages once the cached REST nonce expired. Same-origin requests are now accepted as well.
- Encrypted output now has a noscript notice and can hold several protected blocks on one page. New JavaScript event
init-content-decrypted. New filter:init_plugin_suite_content_protector_decrypt_delay. - Keyword cloaking and noise injection rewritten around one shared HTML tokenizer: keywords no longer break
alt,hrefor other attributes, a keyword such as “class” can no longer corrupt the generated markup, keywords differing only in letter case get separate classes, the longest keyword wins, and noise never lands inside SVG text. About 1.7x faster. - Noise CSS and decryption scripts are only loaded on protected single views instead of every page.
- JavaScript Content Protection: fixed a leak that added a new stylesheet and two listeners on every window focus/blur; form fields, buttons and media controls inside the content keep working; added macOS shortcuts; copy is also blocked when a selection reaches into the content from outside; content added later (infinite scroll) is protected too.
- Advanced DevTools Blocking: a detection on the homepage itself now hides the page instead of redirecting to it, so a false detection can no longer cause an endless reload loop.
- Headless Browser Detection: no longer flags Linux desktops using Mesa GPU drivers or in-app browsers (Android WebView, Facebook, Zalo, Instagram…); detects the HeadlessChrome user agent and Playwright / Selenium IDE leftovers; heavier checks no longer block page scripts.
- Init AntiSnap 6.0: detects the rhythm of scroll-and-stitch capture tools (equal steps, same direction, repeated) instead of single jumps. No longer triggered by find-in-page, anchor links, dragging or clicking the scrollbar, scroll restoration, zooming, or pop-ups that lock page scrolling — while now also catching tools that scroll smoothly and tools that resume after the warning. The blur no longer overwrites inline styles on
<body>. All 5.x config keys are unchanged; newwindow.InitAntiSnapAPI (trust,pause,resume,isDefending,destroy). Theme-providedwindow.InitAntiSnapConfigvalues now take precedence over the plugin’s defaults. - Full WordPress Coding Standards pass, escaped settings link, stricter settings sanitizing, prefers-reduced-motion support for the loading skeleton.
- Updated Vietnamese translation.
1.6 – August 28, 2026
- Added an optional “Enable Headless Browser Detection” setting for Encrypt mode. Runs a first-party client-side check for automation tooling (Puppeteer, Playwright, Selenium/WebDriver) — cumulative signals such as
navigator.webdriver, leftover CDP/WebDriver artifacts, a software WebGL renderer, a Permissions API inconsistency, a webdriver leak through a dynamically-created iframe, and naivenavigator.webdriverpatch artifacts — and, if the session looks automated, simply withholds decryption instead of ever decrypting real content into the DOM for that session. - Scoring requires at least two signals together before triggering (no single flag, however strong, decides on its own), specifically to keep false positives low for real visitors on unusual or privacy-hardened browsers.
- Only takes effect when Content Protection Mode is set to Encrypt — has no effect in “No Protection” mode, since the real content is already present in the initial HTML response before this (or any) JavaScript can run. Off by default.
- Like Advanced DevTools Blocking and Anti-Screenshot Protection, this raises the cost of automated scraping rather than guaranteeing to block it: well-configured “stealth” automation setups can evade individual signals.
- Added
.pot/.potranslations for the new setting..mointentionally not rebuilt as part of this change.
1.5 – August 28, 2026
- Added an optional “Enable Advanced DevTools Blocking” setting, powered by the third-party
disable-devtoollibrary (MIT licensed, vendored inassets/js/disable-devtool.min.js). Unlike “Enable JavaScript Content Protection”, which only blocks a fixed set of keyboard shortcuts, this actively detects DevTools being opened through several different methods and reacts by closing or redirecting away from the tab. The library’s own default fallback URL is the literal string “localhost” (a dead link on a live site), so the plugin overrides it to redirect to the site’s homepage instead. Fully independent of “Enable JavaScript Content Protection” — either can be used alone or together. Off by default. - Added an optional “Enable Anti-Screenshot Protection” setting, powered by “Init AntiSnap” (MIT licensed, vendored as its full, human-readable source in
assets/js/init-antisnap.js). Watches for scroll-jump and DevTools-triggered viewport/resize patterns typical of automated screenshot and scraping tools, and briefly blurs the page with a translatable warning message when detected; the blur clears itself automatically after a few seconds or as soon as the tab regains focus. Off by default, independent of every other protection layer. - Both new options are grouped under a new “Advanced Browser Protection (Experimental)” section on the settings page, respect the existing “Exclude User Roles” setting, and are skipped on the admin area and on AMP endpoints — consistent with every other protection layer in the plugin.
- Moved “Exclude User Roles” into its own new “Global Exceptions” section and reworded its description to explicitly list every feature it governs (Content Protection Mode, JavaScript Content Protection, Advanced DevTools Blocking, Anti-Screenshot Protection, Inject Noise, Sensitive Keywords), instead of the old wording that only mentioned “content protection” and could be misread as scoped to a single feature.
- Fixed the keyword-cloaking CSS output (
::beforerules that visually reconstruct hidden keywords) to also respect “Exclude User Roles”. Previously it was the only protection layer that ignored this setting, so an excluded role’s page still received the keyword-reconstruction CSS even though their content was otherwise left unprotected. - Fixed a bug where that same CSS output function opened a PHP output buffer (
ob_start()) before its early-return checks, leaving it unclosed on any front-end request with no keywords configured or no current post (i.e. most requests on most sites — archives, the homepage). Buffering is now only started once there’s actually CSS to build. - Fixed two accessibility issues on the settings page where a
<label for="...">didn’t match any elementid(“Enable JavaScript Content Protection” and “Inject Noise” checkboxes), which could stop browsers from autofilling correctly and broke the label/control association for assistive tech. - Added/updated
.potand Vietnamese.potranslations for all strings introduced in this release..mointentionally not rebuilt as part of this change.
1.4 – July 20, 2026
- Fixed a critical bug in noise injection: the previous logic split raw HTML on whitespace, so noise spans could be inserted in the middle of tag attributes (e.g. between
<imgandsrc="..."), corrupting markup and breaking layout. Noise is now only ever injected into plain text runs between tags, never inside a tag itself. - Noise injection now skips the entire contents of
<script>,<style>,<pre>,<textarea>,<code>,<select>,<option>,<title>, and<svg>elements, since injecting spans there is invalid markup (breaks dropdowns, SVG rendering) or would corrupt whitespace-sensitive/non-visual content. - Added
aria-hidden="true"to noise spans as defense-in-depth (display:none already hides them from screen readers, this guards against the CSS failing to load). - Added a configurable “Noise Injection Rate” setting (1–50%, default 7%, matching the previous hardcoded rate) instead of a fixed value in code.
- Added an optional “Enhanced” decryption key delivery mode (
includes/rest-api.php): fetches the key via a REST API endpoint after page load instead of embedding it directly in page HTML. Keeps the key out of cached/static HTML and plays nicely with full-page cache plugins. Default “Inline” mode is unchanged for backward compatibility. Deliberately not rate-limited via per-IP transients — that pattern creates one wp_options row per unique visitor/bot IP with no active garbage collection, which would bloat the database far worse than the scraping it aims to prevent. Use server/CDN/WAF-level rate limiting if needed. - Added transient caching for encrypted content, keyed to post ID + last-modified time + encryption key, avoiding redundant OpenSSL/PBKDF2 work on every single page view. Noise injection intentionally remains uncached since its per-request randomness is part of what makes it effective against scrapers.
- Added graceful fallback when a host is missing OpenSSL or PBKDF2 support: previously encryption calls could fatal-error or silently show “Encryption failed” to every visitor; now the plugin fails open (shows real content to visitors, with an admin-only notice) instead of breaking the page.
- Fixed a logic bug where a failed encryption result was still treated as truthy due to
wp_json_encode(false)producing a non-empty string. - Reduced PBKDF2 salt size from 256 bytes to 32 bytes (standard, sufficient size) to cut unnecessary CPU cost server- and client-side.
- Added AMP endpoint detection: protection (JS injection, encryption, noise CSS) is now skipped automatically on AMP pages instead of producing invalid AMP markup.
- Added “Auto-
Follow this listing's changes (Atom feed)