Are you want to prevent visitors from copying your web page content? In this short jQuery article, we’ll show you how to stop content theft from your website using jQuery. For stopping the content copy of your website you can do two things, one is to disable the mouse right click and second is to disable the cut (CTRL+X), copy (CTRL+C) and paste (CTRL+V). Using of jQuery, you can easily disable mouse right click and disable cut, copy and paste from web content.
At first include the jQuery library.
<script src="jquery.min.js"></script>
Disable mouse right click will prevent visitors from choosing the cut, copy and paste options. If you want to disable right mouse click for a particular section of a web page, then you can use a selector (#id
, .class
, etc.) otherwise use body
selector for the full page. The following JavaScript code is used to disable mouse right click.
<script type="text/javascript"> $(document).ready(function () { //Disable full page $("body").on("contextmenu",function(e){ return false; }); //Disable part of page $("#id").on("contextmenu",function(e){ return false; }); }); </script>
The following JavaScript code will disable cut, copy and paste from your web page or a part of your web page.
<script type="text/javascript"> $(document).ready(function () { //Disable full page $('body').bind('cut copy paste', function (e) { e.preventDefault(); }); //Disable part of page $('#id').bind('cut copy paste', function (e) { e.preventDefault(); }); }); </script>
Full JavaScript code for disabling mouse right click and disable cut (CTRL+X), copy (CTRL+C) and paste (CTRL+V) from the web page.
<script type="text/javascript"> $(document).ready(function () { //Disable cut copy paste $('body').bind('cut copy paste', function (e) { e.preventDefault(); }); //Disable mouse right click $("body").on("contextmenu",function(e){ return false; }); }); </script>
Do you want to get implementation help, or enhance the functionality of this script? Click here to Submit Service Request
Hi
How do I prevent visitors from copying our entire website by doing Control A- copy – Paste? and where do I place this code please?
where to put this code in PHP website? plesae, help me.
Thanks for the code. Perefectly work.
how to set this code on blogger site
like blogspot.com
Does it work for tumblr?
I have used in My Website, It’s Working 100% perfect, Thank you Boss.
Hello,
How do we prevent visitors from copying our entire website by simply doing Control A- copy – Paste?
Thanks for emailing the code and where to paste it in selected areas of our domain.
thanks
how to disable touch menu on uc browser
this is amazing.
.
but i want to know that, how can i use this tricks into blogger?
.
please help me bro.
really helping. thanks alot……..
Thank your very much.. it help me to protect my contect.
Thanks CodexWorld for the awesome code . Working great. You saved me lot of time. Keep helping
Hi – would this also prevent the search engines reading the text and hence have an impact on SEO?
nice
Hi, does it work for images?
appreciate your help…really as it will allow me to protect few contents of my website…thanks a lot
Your code very useful, thanks
thax alot stay blessed
thanks a lot
thanks for sharing this info
Your post is very much helpful for me.
Hey! I just want to thanks for your code. it realy works. I LOVE YOU BRO.. Keep inspiring!..
hey thanks for this appreciate it. can you help me how to put social icons fixed near slider
Your code is really very help full to me
Thanks
May I know where to put this code if I use efront lms?
Your code is really very helpfull to me
Thanks
Thank you , it works !
It’s really helpful thank you very much.
Krishanya if right-click is already disabled then the right-click->Print will not be accessible anyway. However, you will also need to disable shortcuts (Ctrl+P) if that’s possible. But even then the print option is available from the browser menu, so you can’t escape someone printing the page if they really wanted to.
IS there a way to prevent right click-> Print?
Thank you very very much, working fine!
I tried using several different codes to disable copying. They all seemed to work, until I tested my site on Microsoft’s Edge browser.
The codes you have posted here are the only ones I’ve found that will disable the right-click, cut, copy, & paste functions in Edge.
Thanks so much for your post!
Hi,
Is it compatible in all browser?
Yes, it’s compatible with all browser.
thanks for the script sir. its very help for protect my content 😀
Thank you sir, really very helpful for me.
May I know where to put this code if I use wordpress?
Put this code before the </body> tag in
footer.php
file of the active WordPress theme.Need help..
I disable all types of copy pesting option on my website.. But now I want to give the permission of copy pesting text for particular part of my website or on a single div.. How can i do this.. plz help…
It works perfectly, thanks.
I required it in my current project where I need to stop users from directly copying, pasting content.
Really helping. Thanks