All things Shopify and commerce
Hi all !
Does anyone knows how to prevent content from being copied ?
It is possible to disable either selection, right clicking or screenshooting ?
Solved! Go to the solution
This is an accepted solution.
Hi @Nykuu
Please try this code in theme.liquid before closing head tag </head>
<script>
// Disable right-click
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
// Disable text selection and copy
document.addEventListener('selectstart', function(e) {
e.preventDefault();
});
document.addEventListener('copy', function(e) {
e.preventDefault();
});
</script>
<style>
/* Disable text selection for most elements */
body {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
Thanks!
I think no way if they know about technical. They can inspect browser and copy as they want
This is an accepted solution.
Hi @Nykuu
Please try this code in theme.liquid before closing head tag </head>
<script>
// Disable right-click
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
// Disable text selection and copy
document.addEventListener('selectstart', function(e) {
e.preventDefault();
});
document.addEventListener('copy', function(e) {
e.preventDefault();
});
</script>
<style>
/* Disable text selection for most elements */
body {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
Thanks!
Hi Nykuu,
This is Impossible on Website to prevent copying or screenshot of content or images.
Thanks
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025