If you are a developer or a writer and you don’t want others to steal your work, then today’s guide is made especially for you. Many developers and website owners—especially those who write articles—face the problem of design theft, style theft, or even full template copying. So let’s understand it step by step: how does content theft actually happen? Whether it’s template codes or written content, the browser makes it easy unless you protect your site.
How to Protect Blogger Content
Content theft usually happens through the browser tools. There are many built-in browser features that make it easy, especially the famous Inspect Element tool in Google Chrome (try pressing F12 now). The same exists in Firefox and other browsers, and unfortunately many people use these tools to steal designs and templates.
Today, we will stop them completely, InshaAllah. Previously I explained how to disable right-click, and now we will complete the protection by disabling F12, CTRL+U, CTRL+SHIFT+I, and similar shortcuts to prevent anyone from taking your template or code.
Steps to Protect Content from Theft
To prevent copying or selecting any text inside your posts:
- Open your Blogger dashboard.
- Go to Theme → Edit HTML.
- Search for
]]> - Paste the following CSS code above it:
.post-body {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-ms-user-select:none;
-moz-user-select:none;
}
.post blockquote,
.post pre,
.post code {
-webkit-touch-callout:text;
-webkit-user-select:text;
-khtml-user-select:text;
-ms-user-select:text;
-moz-user-select:text;
}
JavaScript Code for Full Blogger Protection
This JavaScript disables F12, CTRL+SHIFT+I, CTRL+U, CTRL+C, and more.
- In the HTML editor, search for
</body> - Paste the following code right above it:
<script>
/*<![CDATA[*/
var message = 'This action is not allowed — content protection is active.';
function showAlert() { alert(message); }
document.oncontextmenu = function () {
showAlert();
return false;
};
document.onkeydown = function (e) {
if (
e.keyCode == 123 || // F12
(e.ctrlKey && e.keyCode == 73) || // CTRL+I
(e.ctrlKey && e.keyCode == 67) || // CTRL+C
(e.ctrlKey && e.keyCode == 74) || // CTRL+J
(e.ctrlKey && e.keyCode == 80) || // CTRL+P
(e.ctrlKey && e.keyCode == 85) || // CTRL+U
(e.ctrlKey && e.keyCode == 83) // CTRL+S
) {
showAlert();
return false;
}
};
/*]]>*/
</script>
Code Explanation
This JavaScript code adds multiple layers of protection on your Blogger site:
- A custom alert message is defined to warn users.
- showAlert() displays a popup whenever a blocked action is attempted.
- The script disables right-click using
oncontextmenu. - The script listens for keyboard events to block actions like:
- F12 (open developer tools)
- CTRL + I (Inspect)
- CTRL + C (copy)
- CTRL + J (console)
- CTRL + P (print)
- CTRL + U (view source)
- CTRL + S (save page)
If any of these are pressed, the warning appears and the action is blocked.
Conclusion
In summary, this protection script prevents visitors from using browser shortcuts to access your code, inspect elements, copy content, or view page source. This makes it significantly harder for anyone to steal your designs or templates.
This concludes our guide on Protecting Blogger Content by Disabling F12. See you in another useful tutorial — stay safe!