Bluehost 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 291,827 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

Images Not Displaying On Website

Why don't my images display on my site?

Hotlink Protection

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.

Office 365: Tips and Tricks

How can I learn about the productivity tools included with my Office 365 plan?

Related Help Content

cPanel Image Manager

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?

9 Tips for Working in WordPress

Versatile and robust, WordPress is a favorite among applications and content management systems. This article provides nine tips for working in WordPress.

Password Protect a folder on your website

How do I password protect a folder on my website?

Password Protect a File

How do I Password Protect a single file on my website?

Hotlink Protection Setup

How do I setup Hotlink Protection?

Optimizing Your Images

How can I optimize my images?

9 Things to Keep in Mind When Choosing a WordPress Theme

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.

htaccess Tutorial

What is the .htaccess file and where can I find more information?