Website is own worldwide identity, Build Now In our web project every single line is customizable We are not happy unless our clients are happy Just share your thought, We will provide you a perfect Website

Watch video tutorial for better understanding

Disable right click and prevent copy paste with 2 methods on WordPress

Code for function.php file

if ( !is_user_logged_in() ) {
 function disable_right_click_idc() {
 ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script>
document.addEventListener("contextmenu", function(e) {
 e.preventDefault();
}, false);
$("body").css("-webkit-user-select", "none");
$("body").css("-moz-user-select", "none");
$("body").css("-ms-user-select", "none");
$("body").css("user-select", "none");
</script>
<?php
}
add_action('wp_footer', 'disable_right_click_idc');
}

Optional: Extra CSS layer for Appearance>Customize>Additional CSS

* {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Old versions of Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
   user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */
}

Other Tutorials