Are you concerned about your website’s content or images being misused? Itโs easy for users to copy, save, or hot-link your images, especially on content-rich sites like photography portfolios.
One effective method to help safeguard your content is to disable the right-click option, preventing unauthorized use of your images.
In this document, we’ll explore why you might want to disable the right-click function in WordPress. Additionally, we’ll walk you through three simple methods to safeguard your valuable content.
When to Consider Disabling Right Click in WordPress
Consider disabling right-click if your WordPress site features unique content, especially images. This action can help prevent content theft and discourage image hotlinking, which strains your server and breaches copyright.
However, be aware that disabling right-click can impact user experience, especially for sites where users frequently copy content, like recipes or DIY guides. Additionally, this method isnโt foolproof; savvy users can bypass it through various techniques.
How To Disable Right Click in WordPress
Now that you know how disabling right-click can protect the content on your website.
Let us look into the three ways you can do this in WordPress.
Use the WP Content Copy Protection & No Right Click Plugin
By using the WP Content Copy Protection & No Right Click plugin, you can prevent right-click actions in WordPress and disable commands like CTRL+C.
This plugin goes a step further by disabling CTRL+U in Chrome, preventing users from viewing your page code, which is another method of content theft.
Moreover, you can extend protection beyond images by disabling the ability to select text. Upgrading to the premium version unlocks additional features, such as watermarking and jQuery overlay protection.
To begin, you’ll need to install and activate the plugin in your WordPress.
Once itโs activated and running on your site, navigate to Copy Protection > Settings. Under Main Settings, you can enable protection on your homepage, posts, and more.
When youโre ready, save your settings. You can then test these changes on the front end.
For instance, you might see a warning message when you try to select or copy an image.
Use the Disable Right Click For WordPress Plugin
With the Disable Right Click For WordPress plugin, you can prevent actions like – Cut, Copy, Paste, View source, Save image, and Inspect element.
First, youโll need to install and activate the plugin on the WordPress website.
Next, navigate to Settings > Disable Right Click for WP. Then, select the Yes button for Show messages on Disable Events and click on Save Settings.
Use Astra Custom Layouts to Disable Right-Click
If you’re not comfortable with technical tasks, plugins offer simple solutions. However, be aware that they might slightly slow down your site. Alternatively, you can disable the right-click feature by inserting JS code into your footer.php file using Astra Custom Layouts.
Before proceeding, ensure you have the Astra theme and Astra Pro installed and activated on your website.
<script type=โtext/javascriptโ>
jQuery(document).ready(function () {
//Disable cut copy paste
jQuery(โbodyโ).bind(โcut copy pasteโ, function (e) {
e.preventDefault();
});
//Disable mouse right click
jQuery(โbodyโ).on(โcontextmenuโ,function(e){
return false;
});
});
</script>
Once installed, navigate to Astra > Custom Layouts and select the template to add your JS code to the footer of your website.
With this code in place, users will be unable to right-click on the pages of your website.
It’s straightforward, right? Go ahead and give it a try. Choose the method that fits your website best to disable right-click on your WordPress site.