This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here

Skip to main content

Just Host Web Hosting Help

Right-Click Image Protection

You can stop right clicks with a script (copy and paste it from this page if you want to) in the <HEAD> section of your HTML code.
            <script type="text/javascript">
            
            var msg="mouse right click disabled(or any message you want)";
            
            function click(e) {
            	if (document.all) {
            		if (event.button == 2) {
            		alert(msg);
            		return false;
            		}
            	}
            	
            	if (document.layers) {
            		if (e.which == 3) {
            		alert(msg);
            		return false;
            		}
            	}
            	}
            
            	if (document.layers) {
            		document.captureEvents(Event.MOUSEDOWN);
            		}
            	document.onmousedown=click;
             
            </script>
            
Knowledgebase Article 290,864 views bookmark tags: click code image images javascript protect save saving script tips tricks


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

Why don't my images display on my site?
Knowledgebase Article 254,221 views tags: display image images link site website

I need to protect the /images folder to not show images when people type in the correct URL like www.mydomain.com/images/ to protect from prying eyes.
Knowledgebase Article 172,549 views tags: hotlink htaccess protection

How do I view Thumbnails of images in a directory? How do I scale images? How do I convert an image to a jpg, gif, bmp, or png?
Knowledgebase Article 255,805 views tags: bmp gif images jpg manager png scale thumbnails

Related Help Content

Versatile and robust, WordPress is a favorite among applications and content management systems. This article provides nine tips for working in WordPress.
Knowledgebase Article 82,166 views tags: guide tips tricks wordpress wp

How do I password protect a folder on my website?
Knowledgebase Article 314,091 views tags: folder password protect

How do I Password Protect a single file on my website?
Knowledgebase Article 287,111 views tags: file passwd password prompt protect secure single

How do I setup Hotlink Protection?
Knowledgebase Article 203,921 views tags: link protection

How can I optimize my images?
Knowledgebase Article 235,901 views tags: images optimize

Whether you’re starting from scratch or updating an existing website, choosing the right theme will make it easier to create a professional-looking site and achieve your online goals.
Knowledgebase Article 124,370 views tags: Marketplace certified premium themes tips wordpress

What is the .htaccess file and where can I find more information?
Knowledgebase Article 2,081,852 views tags: htaccess tips tricks

This article will show a way to protect specific pages of your website with SSL. This may have benefits for SEO and can be used on pages that contain forms, shopping carts or any other page where users might enter sensitive information.
Knowledgebase Article 120,465 views tags: htaccess pages specific ssl

** Google ad credits are only available to customers in the United States, Canada, and the United Kingdom at this time.

¹ VAT (Value Added Tax) is not included in our advertised price and will be charged separately and itemized on invoices and billing information. Standard VAT rates based on EU Member State regulations may apply. Learn more.