Home / Disable / Prevent Copy Paste
Duplicate Snippet

Embed Snippet on Your Site

Prevent Copy Paste

This JavaScript snippet prevents right-click and copy events on the frontend

20+
Code Preview
js
document.addEventListener("contextmenu", (evt) => {
  evt.preventDefault();
}, false);
document.addEventListener("copy", (evt) => {
  evt.clipboardData.setData("text/plain", "You must pay a premium subscription to copy our content");
  evt.preventDefault();
}, false);

Comments

Add a Comment