Prevent Right-Clicking on Your Site
To prevent any person visiting your site from right-clicking on any objects on your site, follow these instructions:
- Go to Site Editor
- Click on Settings in the top tabs of the page
- Click on SEO along the left side of the editor
- Copy, then paste, the following code into the box labeled Header Code:
- <script>
document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
return false
}
</script>
- Click on the Save button, on the bottom-right
*Be advised that disabling right clicking is not 100%. For instance, anyone can screenshot a picture on your site, and there is no way to prevent that.