Protecting your content is a vital concern for many online publishers. Recently, one of our readers asked us about preventing text selection and copy/pasting in WordPress, a common strategy to deter content theft.
While not foolproof, this technique can make it more challenging for others to quickly copy text from your website, which can reduce casual content stealing.
In this article, we’ll show you how to easily prevent text selection and copy/paste in WordPress.
Why Prevent Text Selection and Copy/Paste on Your WordPress Site?
Many bloggers find that their content gets stolen and used without permission.
This can happen through automated content scraping. It can also happen if someone manually copies part or all of your content.
One way to make this more difficult is to prevent people from copying and pasting your text. You can do this by making it harder for them to select the text on your website.
Remember, tech savvy users can still view the source code or use the Inspect tool to copy anything they want. These techniques will also not stop people who are using auto-blogging tools to fetch the content using RSS.
Keeping this in mind, let’s take a look at a few different ways to prevent text selection and copying in WordPress.
Method 1: Preventing Text Selection Using CSS
This method is simpler, and you’ll just need to add some custom CSS code to your WordPress theme. If you haven’t done this before, then take a look at our guide on adding custom CSS to your site before you begin.
First, you need to visit the Appearance » Customize page in WordPress admin area to launch the theme customizer.
In theme customizer, you need to click on the ‘Additional CSS’ tab from the left column.
Now, you will see a box to add custom CSS to your WordPress theme. Simply copy and paste the following CSS code into that box.
* {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Old versions of Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Firefox */
}
This is how the code will look when added.
Now, go ahead and try to select some of the text on your page in the live customizer. You will find that you cannot select it.
Don’t forget to click the ‘Publish’ button at the top of the screen to make your changes live for everyone.
Note: This method only allows you to add custom CSS for the currently active theme. If you change your theme, the custom CSS will not be saved. For your code to be saved regardless of which WordPress theme you’re using, we recommend using the WPCode plugin.
Method 2: Preventing Text Selection Using a Plugin
For this method, we’ll be using a WordPress plugin that disables text selection and right-click. This would also protect images from being downloaded and reused.
First, you need to install and activate the WP Content Copy Protection plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, the plugin will work straight out of the box. Users will no longer be able to copy and paste text from your site. They also will not be able to right click or print your content.
If you want to change the plugin’s settings, it’s easy to do so. Simply go to the ‘Copy Protection’ page in your WordPress admin.
Here, you can choose to enable or disable protection for specific types of content.
Make sure you click the ‘Save Settings’ button after making any changes.
You can also change the message that will appear if someone tries to print your content. The message will display like this in the print preview and on the printout itself.
Is it a Good Idea to Prevent Text Selection in WordPress?
While many new website owners want to stop people from copy/pasting content from their site, these techniques don’t really prevent content theft.
Any slightly tech savvy user can easily open your website code source to copy any content that they want.
Also, not everyone copying your text will be a content thief. For instance, some people may want to copy the title to share your post on social media.
This is why it’s not best practice to prevent text selection. We recommend you only use this method if you feel it’s truly needed for your site.
In most cases, it’s better to look for an alternative way to prevent content theft. If a site is re-publishing your content without permission, then you could find out who is hosting the website and send a DMCA takedown notice.
We hope this article helped you learn how to prevent text selection and copy/paste in WordPress. You might also want to see our guide with 12 ways to protect your content in WordPress and our comparison of the best content protection plugins for WordPress.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Dennis Muthomi
I have successfully added the custom CSS method on my main website, as well as three other sites I own. So far, I have not noticed any negative effects, and it provides basic protection against casual copying.
Thanks WPBeginner.
WPBeginner Support
You’re welcome!
Admin
Jiří Vaněk
This is a great guide on how to protect your content against basic copying. I have selected CSS for my site and it seems to work great. Great and thank you. I will be applying to multiple sites.
Yaniv
Thank you. What a champion
WPBeginner Support
You’re welcome, glad our guide was helpful!
Admin
Sri Praneeth P
Thank you for this article. May I know if the CSS code prevents right-click only on the live website or also in the admin area?
Olgi
Hi, is there any setting in robots.txt to prevent content stealing?
fahad
dose Content Copy Protection affect seo ?
WPBeginner Support
It should not affect your SEO.
Admin
Linda
Thank you, this was very helpful as I’ve tried some of the plugins to stop it, but when affiliates wanted to copy their links, they could not. So I used the CSS code and that helped, thank you very much. The affiliates can copy their code but people can’t copy my content.
Do you have an article or CSS code to stop people from copying images as well?
Thanks again, super helpful article.
WPBeginner Support
For preventing image theft, you would want to take a look at our recommendations in the article below:
https://www.wpbeginner.com/beginners-guide/4-ways-to-prevent-image-theft-in-wordpress/
Admin
Sumit Pandey
And you don’t use the CSS yourself.
WPBeginner Support
As a tutorial site that gives codes that users can copy, it wouldn’t be helpful to our visitors if we added that code
Admin
shashwathi
its very useful thank you so much!!
WPBeginner Support
Glad you found it helpful
Admin
Hansjörg
Could you please elaborate also on how to find copy-pasters?
WPBeginner Support
We do not have a specific recommendation at the moment for finding sites copying your content but we will look into the possibility of an article in the future.
Admin
Matt
Option #1 can easily be overridden by looking at the HTML source of the page and copying the text that way.
WPBeginner Support
Given enough work, there are different workarounds for the ways to prevent text from being copied as the goal of a website is to share information but this is one way to help make that process more difficult.
Admin
Gema
Thanks. Very informative
WPBeginner Support
You’re welcome
Admin