Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Prevent Text Selection and Copy/Paste in WordPress (Easy)

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

Recently, one of our readers asked us how they can prevent text selection and copy/paste in WordPress?

Many publishers who want to stop people from stealing their content may want to apply this. This basically just makes it a bit harder for people to copy text from your website.

In this article, we’ll show you how to easily prevent text selection and copy/paste in WordPress.

Preventing text selection and copying & pasting 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.

Opening the theme customizer to add custom CSS

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 */
}

(Code Source)

This is how the code will look when added.

Adding the CSS code to prevent text selection and copy/paste

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 put 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 will 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.

The settings for the WP Content Copy Protection & No Right Click plugin

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.

The default message that users will see if they try to print a protected page/post

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 do not 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 on how to create a membership site with protected content, and our comparison of the best email marketing services for subscriber only content.

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.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

20 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Jiří Vaněk says

    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.

  3. Sri Praneeth P says

    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?

  4. Linda says

    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 says

      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

    • WPBeginner Support says

      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

  5. Matt says

    Option #1 can easily be overridden by looking at the HTML source of the page and copying the text that way.

    • WPBeginner Support says

      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

Leave a Reply to fahad Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.