+2 votes
in Web & Google by (40.5k points)
I want to disable the selection of text on my blog for copy/paste. Is there any easy way to do it without any plugins? I found a couple of plugins, but they slow down the website.

1 Answer

+2 votes
by (353k points)
selected by
Best answer

You can use the user-select property to disable the text selection of your blog post. For this, you need to add some CSS code to WordPress. Log into your WordPress as an admin; go to Appearance -> Customize. There should be a link for "Additional CSS". Click on that and paste the following CSS into the textbox and click on the publish button.

* {
  -ms-user-select: none; /* Microsoft Edge */
  -webkit-user-select: none; /* Safari */
  -webkit-touch-callout: none; /* iOS Safari */
  -moz-user-select: none; /* Old versions of Firefox */
   user-select: none; /* supported by Chrome, Opera and Firefox */

Now text on your blog will be protected from a normal user. Tech users can still view the source code and copy the text.