How to disable copy and paste on WordPress without a plugin
In this article, I will show you the easiest way to disable copy paste in Wordpress without using any plugin.
For this you need to add a small line of CSS code to your website and after that users will not be able to select any text and copy your content.
In this way, you can prevent your content from being stolen by others simply by copy and pasting it as their own. This basically adds a new layer of security to your original content.
Watch the below video to learn the exact process.
How to disable copy paste in Wordpress without plugin?
For this, you need to login into your Wordpress dashboard and open the Appearance > Customize.
Now Select the Additional CSS section and paste the below code in it.
body { -webkit-user-select: none !important; -moz-user-select: -moz-none !important; -ms-user-select: none !important; user-select: none !important; }
Now save the code and the copy-paste functionality is blocked in your Wordpress website.
Here, you can exclude certain areas like code boxes, quote boxes where users can still copy content. just add the code just below the first code.
.post blockquote,.wp-block-code code { -webkit-user-select: text !important; -moz-user-select: text !important; -ms-user-select: text !important; user-select: text !important; }
Here, note that you have to use the CSS class of the element, which you want to exclude.
How to Disable Right Click Without using a Plugin.
To disable right-click in Wordpress, you have to use a small Javascript code in the footer section.
Just go to WordPress dashboard > appearance> edit theme and find the footer.php file.
Now find the </body> tag in the footer.php file and paste the code just above it.
<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>
With this above script, you will be able to block both Copy paste and disable right-click in the browser.
Here, you can use any other code management plugin to paste the code in the footer section.
Preventing Text Selection in WordPress Using a Plugin
if you don’t want to mess around coding and want to use a plugin to prevent text selection, then follow the below steps.
First of all, you have to install and activate the “WP Content Copy Protection” plugin on your Wordpress website.
After installation, the plugin will start blocking the copy-paste and disable the right click on your website. You can further tweak the settings like whether you want to apply it for the whole website or in some specific pages like homepage, post pages, etc.
The best part of this plugin is that now the users will not be able to print the webpage and it will show a warning message on the print preview screen.
Now you understand how to disable copy paste in Wordpress without using any plugin.
If you have any doubts, feel free to ask me in the comment section.
Also Read: Top 10 CSS tricks for Wordpress website.
Thank You. It is working in my website properly. Thanks a lot
bro Javascript code is not working on my website is there any problem with this code or not. I have seen there is no error in the code but unfortunately, it is not working
Why not use the CSS code, it is lightweight and more effective.
Hey, Abhishek padhi
Thanks bro for sharing such a great information…I often face the issues someone copy my blog content..
I will apply the code on my blog… thanks
yes, this will help you protect your content most of the time.