Ads are pain !! But this is only way to manage server cost. Join Group!

Protect Content From Theft by Disabling F12

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated


If you are a developer or writer and do not want others to steal your effort, then today this topic is dedicated to you in particular. Many developers and website owners, especially those who write texts, suffer from the problem of design theft and theft of styles and templates in general but let us take it step by step. How is design stolen? Whether template codes or content?

How to protect content in Blogger

Of course, the way to steal content is through the browser itself, and many tools clearly help in this, one of the most famous tools is the Inspect Element tool in Google Chrome (try now pressing F12), and there is also a tool in Firefox. Unfortunately, many people use it to take people's signs and violate them, but today we will completely stop their movement, God willing. I previously explained disabling the right click, and today we will complete the protection by disabling F12 in browsers, to prevent them from taking anything from your designs.

Steps to protect content from theft:

To prevent copying and selecting any text within your posts

  • Enter your blog.
  • Appearance, edit HTML template.
  • Look for ]]></b:skin>

Paste this code above it:

  .post-body {






.post blockquote,.post pre,.post code{






JS code to protect your Blogger blog

This is a generic Javascript code that disables the F12 button, prevents the CTRL+SHIFT+I button, and prevents the CTRL+U button.

From within HTML Edit search for <body/>

Immediately before it, add the following code:



var message = 'This is not allowed to protect the content.';


function showAlert() {



function clickIE4() {

    if (2 == event.button) {


        return false;



function clickNS4(e) {

    if ((document.layers || (document.getElementById && !document.all)) && (2 == e.which || 3 == e.which)) {


        return false;



document.oncontextmenu = function () {


    return false;


document.onkeydown = function (e) {

    if (

        123 == event.keyCode ||

        (e.ctrlKey && 73 == e.keyCode) ||

        (e.ctrlKey && 67 == e.keyCode) ||

        (e.ctrlKey && 74 == e.keyCode) ||

        (e.ctrlKey && 80 == e.keyCode) ||

        (e.ctrlKey && 85 == e.keyCode) ||

        (e.ctrlKey && 83 == e.keyCode)

    ) {


        return false;





Explanation of the code

This code is part of the JavaScript programming language and is used to implement some actions to protect the content on a web page. Let's explain what the code does:

  • . The variable `message` is defined with the value “ This command is not allowed for content protection, ” which is the text that will be displayed in the alert window.
  • . The function `showAlert()` is defined that displays an alert window (`alert`) containing the value of the variable `message`.
  • . The `showAlert()` function is set to execute when the `oncontextmenu` event occurs, which is activated upon right-click (right-click).
  • . The similar function `showAlert()` is set to execute when the `onkeydown` event occurs, which is activated when key buttons are pressed.
  • . The condition inside the `onkeydown` function checks for the following events:
  • - Press the F12 key (123 == event.keyCode).
  • - Press Ctrl+I (e.ctrlKey && 73 == e.keyCode).
  • - Press Ctrl+C (e.ctrlKey && 67 == e.keyCode).
  • - Press Ctrl+J (e.ctrlKey && 74 == e.keyCode).
  • - Press Ctrl+P (e.ctrlKey && 80 == e.keyCode).
  • - Press Ctrl+U (e.ctrlKey && 85 == e.keyCode).
  • - Press Ctrl+S (e.ctrlKey && 83 == e.keyCode).

If one of these events is detected, the `showAlert()` function is called and the default behavior of these events is suppressed by `return false`.


Conclusion -

In general, the goal of this code is to prevent visitors from using some actions available in the browser such as opening developer tools (F12), copying text (Ctrl+C), printing the page (Ctrl+P), etc. An alert message is displayed to the user informing them that the action is not allowed on this page.



In this article, I shared with you Protect Content From Theft by Disabling F12. I hope you have liked It. Please do share it with your friends and follow our blog for more.

If you face any problems in Demo, Download or have any questions so feel free to ask me in comments section or join our Telegram Channel to get the lastest posts updates daily.

Our All Posts Are Protected By DMCA. So Don't Try To Copy Our Posts And Reproduction In Any Way Is Strictly Prohibited! Or else Legal Actions Will Be Taken.

Jirale offers expert insights on technology, gadgets, software, and more. Explore our articles to stay ahead in the fast-paced world of tech.


  1. How to copy it?
    1. Check again
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.