First of all, Thank you, David, I greatly appreciate your help!
The above PHP snippet and CSS are working like a charm! ??
But David, I have already installed 20+ plugins and I have already told you. I don’t want other plugins and I want to remove plugins one by one When I find alternative options. To use this custom function, I need to install the Code Snippets plugin so I have made some changes.
First, I create a new Hook Element. And add the script like this:
<script>document.addEventListener('contextmenu', event => event.preventDefault());</script>
and set the hook to wp_footer
then set the Display Rules to “Entire Site”.
After that, I add the below CSS code in Appearance > Customize > Additional CSS.
html {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
Finally, I achieve my desire result. The right click and copy and paste are now disabled. now users can’t steal my content.
David, I want to ask one last question. Have I followed the correct method to disable right click and copy and paste? because I get the desired result without installing the “Code Snippets” plugin.