Archived topic
evitar-que-copien-el-contenido-de-nuestro-blog-o-pagina-web
1 reply · Started by Juan Carlos Rodriguez Trapote on April 1, 2019
Hola a tod@s,
quiero evitar que copien el contenido de mi sitio web sin añadir plugin, solo con este codigo:
<body oncontextmenu=’return false;’ onmousedown=’return false;’onselectstart=’return false;’>
Imagino que tendré que ponerlo en el Theme Childen de GeneratePress, pero ¿Dónde?
Gracias y saludo.
Hi there,
It would likely be better to use javascript.
1. Create a Hook Element: https://docs.generatepress.com/article/hooks-element-overview/
2. Set the hook to wp_footer
3. Add this as the hook content:
<script>document.addEventListener('contextmenu', event => event.preventDefault());</script>
Then set the Display Rules to "Entire Site".
However, there is no way to prevent users from stealing your content if they want to. Lots of info on this here: https://stackoverflow.com/questions/737022/how-do-i-disable-right-click-on-my-web-page