Creating good quality content is a time and energy-consuming process, but the internet is a fickle place and content can easily be stolen at the click of a button. One method of deterring content thieves is to disable right-clicking on your WordPress website.
There’s no worse feeling than seeing your intellectual property and creative work used or altered slightly and displayed on another site. Content, in the form of both text and images, takes ages to create, and of course, you’d want to protect your work at all costs.
In the following post, we’ll show you how to disable the right click on your WordPress website so you can protect your content from being copied. You’ll learn how to implement this in two ways; either by using a plugin or manually entering code onto your webiste.

Should You Disable the Right Click on Your Website?
If you’re trying to find a way to protect your content, disabling the right click function in WordPress is a way to go, but is this always the best solution?
At first, right-click protection seems like a no-brainer. Disabling the right click function protects your content from being copied easily. Without this ability, content thieves won’t be able to simply pinch your work from your blog, website or portfolio site.
In a really tough scenario, you could see your words or images on another site, without credit or link back to you as the original source. Adding insult to injury, if the copycat website scores higher volumes of traffic than your site and maybe even turns a higher profit than you, you’d be furious, and possibly even discouraged from continuing to create content.
On the other hand, disabling the right-click functionality may be irritating to some users. Not everyone that visits your website is trying to steal your work, and some users may need to use the right-click functionality for other reasons. With the right-click disabled on your website, you may end up annoying some site visitors and create a bad user experience for your site.
One thing to keep in mind is that if someone really wants to copy your content, they’ll find a way. They could take screenshots of your work or use photo editing tools to copy images, or ask a virtual assistant to copy your text content word-for-word.
Still, disabling the right click on your WordPress website is a good deterrent, and it sends a clear message to anyone trying to be sneaky that you’re onto them.
How to Protect Your Content and Disable the Right-Click in WordPress
There are two methods that you can use to protect your content. The first method is to use a plugin, the second is a manual method that requires adding code to your WordPress website. Before you make any changes to your website, we recommend making a backup of your site either using a plugin or manually.
Disable the Right-Click Using a Plugin
A quick and easy way to disable the right-click functionality is to use a plugin. A safe and reliable plugin is WP Content Copy Protection & No Right Click, a free plugin available from the WordPress repository. There is also a premium, paid version of the plugin that includes additional features. To begin, install the plugin on your WordPress website.
Once the plugin is activated, it’ll automatically begin working. To test that the plugin is in action, head to the front-end of your website and try to right-click anywhere on the screen. You’ll see an alert notification “Alert: Content is protected” as soon as you do.
If you need to change any of the plugin’s settings, head back to the Dashboard and you’ll see a menu item called Copy Protection. Here, y9ou’ll find the plugin’s configuration details.
From here you can:
- Enable or disable right-click copying from blog posts, the homepage or the static pages on your site
- Choose to hide or display the plugin’s green lock icon in the admin bar
- Change the text displayed when someone attempts to copy the content
This is a really quick and easy way to protect your website’s content. If you’d prefer not to use a plugin you can opt for a manual route instead.
Disable the Right-Click Using Code
If adding another plugin to your website isn’t the route you’d like to go, you can disable the right-click in WordPress without a plugin by adding a few lines of code to your site. If you are opting for this route, make sure you have a child theme set up, installed and activated.
There are three different methods of adding this code to your website. You could either
- Create a new page, add the Divi code module somewhere and enter the code there
- Enter the code into the Divi Theme Options > Integration tab, in the option that says “Add code to the < head > of your blog”. Note, make sure the toggle “Enable header code” is enabled.
- Add the code to a folder inside your child theme. For this method, make sure you enqueue the script code in the functions.php file.
Need more info? We have a detailed tutorial covering each of the options of adding JavaScript and jQuery to Divi.
Copy the following code and remember to change the demo text to something custom. Here is a demo of the code in action.
// Copyright: Aspen Grove Studios, August 25th, 2021. // Licensed under the GNU General Public License, no warranty; // License link: https://www.gnu.org/licenses/gpl-3.0.en.html // Disables right clicking for images only jQuery(function(){ jQuery( "img" ).contextmenu(function() { alert( "Here is your custom alert for user" ); // this line can be deleted if you don't' want alert to be displayed return false; }); }); // Disables right clicking for body element jQuery(function(){ jQuery( "body" ).contextmenu(function() { alert( "Here is your custom alert for user" ); // this line can be deleted if you don't' want alert to be displayed return false; }); }); // Disables right clicking for paragraphs only jQuery(function(){ jQuery( "p" ).contextmenu(function() { alert( "Here is your custom alert for user" ); // this line can be deleted if you don't' want alert to be displayed return false; }); });
Once the code is enabled, it’ll prevent someone from right-clicking on every page of your website.
Ending thoughts
Now that you know how to disable the right click on your site, you can protect your content from theft and copying. Keep in mind, people are crafty and if someone wants to pinch your content badly enough, they’ll find a way. Also, from a text-content perspective, if your URL was the first to publish content, search engines are smart enough to know that yours is the original source, and any URL with copycat content will be penalized as duplicate content.
We hope that you’ve found this post helpful! Have you disabled the right-click functionality on your website before? If you have, let us know in the comments section below!
Thank you so much it worked.
hi lisa-robyn keown, great article. imho there s no good reason to disable right click.. to protect content? it s not worth the time. apple s new cam function with char recognition is a „weapon“ you can not defeat with disabeling right click on your page.
kind regards
We agree that there are several ways around this but it is a good deterrent for the average internet user who does not know more advanced techniques
Nice and simple, I don’t like the plugin I’m using so this is a great bonus to replace it. Thanks for the code it’s much appreciated.