This snippet disables the browser’s right click menu across your entire site, helping to prevent casual users from saving images, copying text, or viewing source. While it blocks the most common interaction, it is not a security measure as advanced users can still inspect your site with developer tools.
Add this code with a snippets plugin right before the closing </body> tag.
document.addEventListener("contextmenu", function (e) {
e.preventDefault();
});
Some solutions only work on the live site. Always publish and test after each change, as results may not appear in the editor.