Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsYou can turn off right-click menus and text selection on a Hostinger AI Builder site in manual mode by pasting a supplied JavaScript snippet into the site’s Integrations > Custom code field. Hostinger’s own support guide says this is a deterrent, not a reliable way to protect content, and that visitors can still get around it.
Steps to add the copy and selection restrictions
Hostinger’s support article “Hostinger AI Builder: How to disable copying or selecting website content in manual mode” describes one workflow for both restrictions. The steps below follow that guide.
As an Amazon Associate I earn from qualifying purchases.
- Open your website in Hostinger AI Builder and make sure it is in manual mode.
- In the site editor, click the More (⋯) menu, then choose Integrations.
- Paste the snippet you want into the Custom code field. Use the context-menu snippet, the text-selection snippet, or both, depending on which behavior you want to restrict.
- Save the changes and update the website so the snippet goes live.
- Open the published site in a browser and confirm the behavior you added. Hostinger’s guide does not state which browsers it tested, so check the browsers your visitors are most likely to use.
Hostinger’s broader manual-mode documentation distinguishes between the Integrations Custom code field, which it describes as the place for scripts that load in the page head, and the Embed code element, which it describes as the place for code in the page body. For this restriction, follow the guide’s instruction to use the Custom code field.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →The two snippets Hostinger publishes
Hostinger documents two separate snippets. They do different things, so decide which one you need before you paste anything.
#1 Best Overall
Blocking the right-click context menu
This snippet listens for the contextmenu event, which fires when a visitor right-clicks, and cancels it. Visitors who right-click see no context menu, which removes options such as “Copy” and “Save image as” from that menu.
<script>
document.addEventListener('contextmenu', event => event.preventDefault());
</script>
Preventing text selection
This snippet listens for the selectstart event, which fires when a visitor begins selecting text, and cancels it. Because the text cannot be highlighted, the most common way of selecting and copying a passage is blocked.
Rank #2
<script>
document.onselectstart = () => {
event.preventDefault();
}
</script>
Both snippets are reproduced as Hostinger published them. The guide does not explain how they behave in individual browsers, so treat their behavior across browsers as unverified.
What these restrictions do and do not stop
Hostinger states plainly that this approach is “not foolproof.” A visitor who inspects the page source or turns off JavaScript can get to the text, so the snippets only raise the effort required. Hostinger also warns that the restriction “can be seen as an annoying user experience” and says it is “not recommended for most websites.”
The snippets target only the context-menu and text-selection events. The guide does not address other routes, such as keyboard shortcuts, browser menus, or screenshots, and neither snippet should be relied on to stop them. Describe the result to readers and clients as an interaction restriction, not as copyright enforcement or a security control.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Other protections Hostinger mentions
The same support article points to other options for protecting content: watermarking images, server-side security, and relying on copyright protection. The guide does not compare how well these work or explain how to set them up, so treat them as directions to research separately rather than as a tested ranking. If the content you want to protect is high value, watermarking images and understanding your copyright options are usually more practical starting points than a script.
Quick Recap
Should you use these snippets?
- Use the context-menu snippet if you only want to stop casual right-click saving of images or copying of short text, and you accept that visitors can still bypass it.
- Use the text-selection snippet only if you want to prevent highlighting of text and can accept that it will make the page feel restricted to readers.
- Skip both if your main goal is protecting paid or proprietary material. Hostinger itself says the method is not foolproof, so use server-side access controls or other protections for content that must stay private.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




