You Are Here: Home > Articles > Stealth & Security > Article


How To Disable "Copy And Paste" To Protect Your Source Code And Images

by Nelson Tan

Have you ever worked really hard on graphics for your site only to find later that someone has stolen them as their own. You can fully encrypt and protect your site with HTML-Protector and the scripts below will help against novices.

"No Right Click" JavaScript For Images

Use this script so when someone right-click to save an image off your page, a message will come up letting people know that your information is copyrighted.

This script only works on newer browsers, and it's not foolproof. If someone really wants something from your page they can find ways around it, but at least it's a warning to people who want to take your graphics. Copy and paste the following code, and make sure it comes right after your <HEAD> tag:

<script language="JavaScript">
var popup="Sorry, right-click is disabled.\n\nThis Site Copyright ©2000";
function noway(go) {
if (document.all) {
if (event.button == 2) {
return false;
if (document.layers) {
if (go.which == 3) {
return false;
if (document.layers) {
// --> </script>

"No Right Click" JavaScript For Source

Here is a handy little script which will not only protect your images from right-clicking, but your whole page. Remember this only stops some visitors from viewing your source. There are ways around it and if someone really wants to view your source they may find a way. There is another trick below to protect your source code.

This script works best if placed within the head tags of your HTML:

<script language="JavaScript1.1">
<!-- var debug = true;
function right(e)
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
alert('This Page is fully protected!');
return false;

return true;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);

Disable "Copy And Paste"

One of the most popular security questions is "How do you stop visitors from stealing your web page information?"

Below is a little trick that will stop your visitors from copying and pasting your web page information. Anyone with experience may know a way around this trick. However it will make it hard enough to discourage them and get them moving on to easier targets.

Add the following HTML code to your <BODY> tag: <body bgcolor="#FFFFFF" ondragstart="return false" onselectstart="return false">

Then try to highlight text by holding left-click and dragging the mouse cursor. You will see that nothing works.

Make Your Source Code Vanish!

Now before I show you this last trick to protect your source, I would like you to first view my source. Just click "View" then choose "Source".

How did I do that?

Place your cursor in front of the opening <HTML> tag and hit your enter button for a while. It will push your source code out of view and this will fool the fools. Just a cheeky solution.

These are rather simple yet effective tricks for webmasters of all levels to implement even a 'sense' of security for their own site protection. However, when you are prepared to invest in a more powerful software, we recommend HTML-Protector for its ability to prevent e-mail address extraction, password-protect your web pages, encrypt links (especially order links!), disable screen-capture and many more!

For further information, click here to visit the Features and FAQ sections.


Nelson Tan is the webmaster behind Internet Mastery Center where you can download $347 worth of FREE Internet Marketing gifts!


Share this article:

TwitCount Button

comments powered by Disqus

Get free news, updates, strategies and special offers from Internet Mastery Center delivered to your inbox. Simply fill in your name and e-mail address to download your FREE e-book in the right sidebar. It only takes a MINUTE!   For top stories in Internet Marketing, follow us on Twitter at @webmastery.


Passive Profit Breakthrough

Passive Profit Breakthrough

Discover how to make your first $10,000 dollars per month and beyond with list building, e-mail marketing and affiliate marketing.

Speed Wealth

Speed Wealth

Discover the secret hacks and tricks used to generate no-cost laser-targeted traffic and generate $100+/day in ANY NICHE!

Latest Blog Posts

For more Internet Marketing updates >>


Saturday, 24 Mar 2018 05:47 AM


Download your FREE report on social networking/bookmarking.

Monetizing Secrets Of Going Web-SocialInside this 92-page report is a social media marketing blueprint proven to generate more traffic and leads with the latest Web 2.0 strategies. It focuses on 2 hot aspects of Web 2.0: social networking and content propagation. It also suggests resource links to Web 2.0 scripts and tools and how you can employ Internet Marketing techniques to convert visitors from social networking sites.

Subscribe Now...It's FREE!

Connect With Nelson At:


Blog Profits Blueprint

Hosted By Web Hosting by iPage

Submit Your Links

Internet Mastery Center has been providing Internet Marketing expertise since December 2003. Its mission is to ensure every aspiring marketer is well equipped with all the necessary Internet Marketing know-how and programs.
Copyright © Internet Mastery Center. All rights reserved.   
Anti-Spam Policy | Terms Of Use | Privacy Policy | Affiliate Agreement | Site Map