How to disable copy and paste on WordPress without plugin
In this article, I will teach you the simplest way to disable copy and paste in WordPress without using any plugin. For this you just have to add a small line of CSS code on your website so that users will not be able to select any text or copy content from your wordpress website. By this way, you can prevent your content from being stolen by others, simply by copy and pasting it as their own content. This actually adds a new layer of security to your original content.
Disable copy paste in WordPress without plugin
- For this open your wordpress dashboard then Appearance > Theme > Customize
- Now go to Additional CSS and paste the code given below
body {
-webkit-user-select: none !important;
-moz-user-select: -moz-none !important;
-ms-user-select: none !important;
user-select: none !important;
}
- Now click on publish, this will save your additional CSS and will disable copy paste from your wordpress website.
One thing to note here, By using the above code to disable copy paste you are also disabling copy pasting from code boxes from your wordpress website. If you do not want to disable copy paste from code boxes, you can add the code given below after the code that you used to block copy paste.
.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;
}
The process is shown in the image below for your assistance.
Disable Right Click without using any plugin
If you also want to disable right click on your wordpress website without using any plugin you can use this method to do so.
- First of all login to your wordpress dashboard.
- Then select Appearance > Theme file editor
- Find footer.php from the right menu.
- Paste the code given below just before the closing body tag </body>.
<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>
The process is shown in the image below.
This code is going to disable right click as well as copy and paste from your wordpress website. However if you don’t want to edit your theme file then you can use any copy paste blocker plugin to do the above work.
Preventing copy and paste using a plugin
WP Content Copy Protection is one of the best plugins if you want protect your original work from getting copy pasted. You can install and activate the “ WP Content Copy Protection ” plugin on your WordPress website. After installation, the plugin will block copy-paste and also disable the right click on your website. You can further configure 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 the users will not be able to print your webpages also, it will show a warning message on the print preview screen.