{"id":11155,"date":"2025-06-19T12:20:53","date_gmt":"2025-06-19T06:50:53","guid":{"rendered":"https:\/\/veewom.com\/articles\/?p=11155"},"modified":"2025-06-19T12:21:46","modified_gmt":"2025-06-19T06:51:46","slug":"disable-right-click-and-f12-key-using-javascript","status":"publish","type":"post","link":"https:\/\/veewom.com\/articles\/disable-right-click-and-f12-key-using-javascript.htm","title":{"rendered":"How To Disable Right click &#038; F12 Key on a Website Using Javascript"},"content":{"rendered":"<p style=\"text-align: justify;\"><strong>Disable Right click &amp; F12 Key Using Javascript<\/strong> | Hello everyone, in this article I will discuss on how to protect website content from being copied ,mean&#8217;s in this article I will show you how to disable mouse right click and keyboard F12 key using javascript.<\/p>\n<p><iframe loading=\"lazy\" title=\"How To Disable Right click ,F12 Key and Text Select  on a Website 2018\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/7AGQdazCXHE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<blockquote>\n<p style=\"text-align: justify;\">Just copy and paste below code into your website head section .if your website in WordPress , so goto Appearance, Editor and find header.php file and paste below code above &lt;\/head&gt;.<\/p>\n<\/blockquote>\n<h2>Disable Right click &amp; F12 Key<\/h2>\n<pre><code class=\"js\">\r\n&lt;script&gt;\r\n\twindow.oncontextmenu = function () {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$(document).keydown(function (event) {\r\n\t\t\t\tif (event.keyCode == 123) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\telse if ((event.ctrlKey &amp;&amp; event.shiftKey &amp;&amp; event.keyCode == 73) || (event.ctrlKey &amp;&amp; event.shiftKey &amp;&amp; event.keyCode == 74)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t&lt;\/script&gt;\r\n<\/code><\/pre>\n<h2>Disable Text Select<\/h2>\n<pre><code class=\"js\">\r\n -webkit-touch-callout: none; \/* iOS Safari *\/\r\n -webkit-user-select: none; \/* Safari *\/\r\n -khtml-user-select: none; \/* Konqueror HTML *\/\r\n -moz-user-select: none; \/* Firefox *\/\r\n -ms-user-select: none; \/* Internet Explorer\/Edge *\/\r\n  user-select: none; \/* Non-prefixed version, currently *\/\r\n<\/code><\/pre>\n<p style=\"text-align: justify;\">We hope this article helped you learn how to easily disable right click and F12 Key. You may also want to see &#8211; <a href=\"https:\/\/veewom.com\/articles\/how-to-change-default-wordpress-email-address.htm\" rel=\"noopener\">How To Change The Default WordPress Email Address<\/a>.<\/p>\n<p style=\"text-align: justify;\">If you liked this article, then please share to social networking site. You can also find us on <a href=\"https:\/\/twitter.com\/veewom\" rel=\"noopener\" target=\"_blank\">Twitter<\/a>,<a href=\"https:\/\/www.facebook.com\/veewom\" rel=\"noopener\" target=\"_blank\">Facebook<\/a> and <a href=\"https:\/\/www.instagram.com\/veewom\" rel=\"noopener\" target=\"_blank\">Instagram<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Disable Right click &amp; F12 Key Using Javascript | Hello everyone, in this article I will discuss on how to protect website content from being copied ,mean&#8217;s in this article I will show you how to disable mouse right click and keyboard F12 key using javascript. Just copy and paste below code into your website &hellip; <a href=\"https:\/\/veewom.com\/articles\/disable-right-click-and-f12-key-using-javascript.htm\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How To Disable Right click &#038; F12 Key on a Website Using Javascript&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":11156,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[240,241,239,238,66,82],"class_list":["post-11155","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-block-right-click-on-blog-and-website","tag-blogger","tag-disable","tag-disable-right-click","tag-how-to","tag-javascript"],"featured_image_src":"https:\/\/veewom.com\/articles\/wp-content\/uploads\/2018\/01\/How-To-Disable-Right-click-F12-Key-on-a-Website-Using-Javascript.png","author_info":{"display_name":"Editorial Staff","author_link":"https:\/\/veewom.com\/articles\/author\/admin"},"_links":{"self":[{"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/posts\/11155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/comments?post=11155"}],"version-history":[{"count":2,"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/posts\/11155\/revisions"}],"predecessor-version":[{"id":12600,"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/posts\/11155\/revisions\/12600"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/media\/11156"}],"wp:attachment":[{"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/media?parent=11155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/categories?post=11155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/veewom.com\/articles\/wp-json\/wp\/v2\/tags?post=11155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}