Disable Right Click and Copy Events from WordPress Frontend

Do you want to prevent users from copying the content of your WordPress website? By using the PHP snippet given below, it will stop users from right-clicking on your website and copying the content of your website. Add it to your theme's functions.php file:

function themesdna_disable_right_click_copy_events() {
    ?>
    <script>
    document.addEventListener("contextmenu", (evt) => {evt.preventDefault();}, false);
    document.addEventListener("copy", (evt) => {
      evt.clipboardData.setData("text/plain", "You do not have permission to copy our content.");
      evt.preventDefault();
    }, false);
    </script>
    <?php
}
add_action('wp_head', 'themesdna_disable_right_click_copy_events');

Our WordPress Themes

Below are some of our premium WordPress themes. View all our free and premium WordPress themes →
CleanWP PRO WordPress Theme

CleanWP PRO

If you like CleanWP free WordPress Theme, you will love the CleanWP PRO version. The premium version of CleanWP WordPress...

$25.00
HotWP PRO WordPress Theme

HotWP PRO

If you like HotWP free WordPress Theme, you will love the HotWP premium version. HotWP PRO is easy to use,...

$25.00
BoxWP PRO WordPress Theme

BoxWP PRO

If you like BoxWP free WordPress Theme, you will love the premium version. BoxWP PRO is an elegant, user-friendly, feature-rich,...

$25.00
FlashWP PRO WordPress Theme

FlashWP PRO

If you like FlashWP free WordPress Theme, you will love the premium version. FlashWP PRO is advanced, more user friendly,...

$25.00
MaxWP PRO WordPress Theme

MaxWP PRO

If you like MaxWP free WordPress Theme, you will love the premium version. MaxWP PRO is feature-rich, easy to use,...

$25.00
NeatMag PRO WordPress Theme

NeatMag PRO

Do you like the NeatMag Free WordPress Theme?, Then you will love the premium version. NeatMag PRO is very user...

$25.00
EliteWP PRO WordPress Theme

EliteWP PRO

If you like EliteWP free WordPress Theme, you will love the premium version. EliteWP PRO is an advanced, very user...

$25.00
TidyMag PRO WordPress Theme

TidyMag PRO

If you like TidyMag free WordPress Theme, you will love the premium version. TidyMag PRO is easy to use, feature-rich,...

$25.00

Can't you choose a single theme? Purchase All Themes for $75.

Save money with our low, one-time price for access to all of our 55 WordPress themes.