Disable copy-paste in WordPress without 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.

YouTube video

How to disable copy paste in WordPress without plugin?

For this, you need to login into your WordPress dashboard and open the Appearance > Customize.

Steps to Disable copy paste

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.

Disable right click in WordPress

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.

Similar Posts

2 Comments

  1. Fd Shakil says:

    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

Leave a Reply

Your email address will not be published. Required fields are marked *