Disabling Copy on Live Pages

Hi all, Hope you’re having a great week.
Has anyone attempted to disable text selection, right-click, copy functions on their pages?

Here are a few ways to do it, but wondering if there is a better way. https://www.makeuseof.com/disable-text-selection-cut-copy-paste-right-click-on-web-page/

We spent a lot of time an money researching and structuring our data, and really don’t want someone copy-paste everything… at least not so easily.

(We had someone suggest to us that they could “just copy your site information” to make their project really easy, and expect us to be happy about it. IP / copywrite laws don’t prevent, and certainly don’t punish without a LOT of headache. Most of the time, people are simply ignorant to the fact that copying more than a small amount of information is illegal)

1 Like

Hi,
This would help you

Or

<script>
document.addEventListener("contextmenu", (event) => {
  event.preventDefault();
});
</script>

It would prevent the right click possibility. To be put in the footer code, in page
settings

To prevent text selection, in addition:

<script>
document.body.style.userSelect = "none";
document.body.style.webkitUserSelect = "none";
document.body.style.msUserSelect = "none";
document.body.style.mozUserSelect = "none";

document.addEventListener("contextmenu", (event) => {
  event.preventDefault();
});
</script>

3 Likes

Thank you! I saw the prior discussion but it looked like the solution involved using frames. I need search engines to be able to crawl and index my page content.

This snippet is super helpful. Anything to watch out for or check wrt conflicts, speed or unintentionally poor UX (beyond frustrating someone who wants to copy the content)? Any knowledge on whether or not it will impact SEO?

Glad that it can help you!
Nope, unfortunately I don’t have that level of knowledge for now (I’m an amateur and not a dev).

Just that it doesn’t affect speed

No worries. Thank you. I really appreciate your help. I have another Q, but its unrelated. Will start a new topic.