How to disable right click context menu on images in wordpress
Posted in How to, Wordpress By SureyeaInternet becomes way easier to find whatever information’s like texts, images, media files etc. Content and images originates mainly from one place and that will be reproduced, modified and reused on other sites. For content scrapers it doesn’t matter that you own copyright for your images and content, they still make a copy and publish it elsewhere. You cannot completely protect your work from folks who plagiarize content and images. But by taking several measures you can prevent such activities. Are you are very much bothered about people stealing your copyrighted images? Here we will see how to disable right click context menu on images in wordpress.
Also Read: How to prevent image hotlinking in wordpress
There are many possible ways to copy images from your website, but the easiest and most used way is from context menu. By disabling right click on images you can greatly protect your images. The other method people try is by dragging and dropping the images from your wordpress site to desktop. Here we will see disabling both the features.
How to disable right click context menu on wordpress images
Install and activate no right click images plugin. After activation you will see an option “no right click images” under settings tab. To disable right click context menu on wordpress images this plugin uses JavaScript in the footer of every page. It disables right click functionality only on images and not on other normal links. It comes with four options.
Replace image on right mouse click – You can set a custom default image to appear when someone right clicks on your images.
Prevent drag and drop – You can stop people from dragging and dropping images straight to their desktop.
Allow for logged on users – You can enable right click functionality on images for logged in users.
Stop saving on smart phone – You can stop images from saving on smart phones.
Anyhow the above plugin lacks one feature that is disabling right click on specific images which we will try it manually.
Disabling right click on specific wordpress images
No right click images plugins disables right click option to all your wordpress images. What if you wish to disable right click on any single image or specific images in your posts or pages. Here is a manual try.
Usually you add images to your wordpress post from visual editor, but the actual image tag that you see in HTML editor looks something like this.
<img title=”Add no right click to wordpress images” alt=”Disabling right click on wordpress images” src=”https://blogtimenow.com/images/disable-right-click-wordpress-images4.jpg” width=”125″ height=”125″ />
What we are going to do in remove the image tag <img> and add division <div> tag in HTML editor just like this.
<div style=”width: 432px; height: 270px; background: url(‘https://blogtimenow.com/images/disable-right-click-wordpress-images4.jpg‘) no-repeat;”></div>
Now the image looks like this, which doesn’t disables right click function, but when right clicking on image there will be no such options like “save image as“, “open image in new tab“, “copy image” and “copy image URL“. Also the image can’t be dragged.
You can change width and height, but you cannot add title and alt attributes that you normally do for image SEO.
Hope this post helped you on how to disable right click context menu on images in wordpress. Now you are greatly protecting your wordpress images from copying, who are less technical. Share it and drop your comments below.
Related Posts
- What is Gravatar? Why to use Gravatar and how to get Gravatar? One of my close friends asked me about how to get a picture in wordpress comment section. He also said that he sees some grey human icon, funny cartoonistic icons...
- How to add copyright symbol with dynamic date in wordpress footer Are you tired of updating the copyright date each year in your wordpress site? Here is a simple code that adds copyright symbol with dynamic date in wordpress footer. By...
- Finding category ID, tag ID, post ID, comment & user ID in wordpress Are you in need of finding your wordpress category ID, tag ID, post ID, page ID, comments ID or user ID. At some cases you will need these IDs especially...
- How to change font family, color, style and font size in wordpress Changing font family and adding a detail to your Font style, font color and font size will totally give a different look to your site. To make you site more...
- How to add border, frame and shadow effects to your wordpress images Do you like to hang pictures around your wall without framing it? No one does! A picture without a frame doesn’t look cool and it is not even a picture,...