Disable Right-Click and Text Selection in WordPress: If you’ve spent hours creating a great blog post or designing your website, it can be frustrating when someone copies your work with a simple right-click. Don’t worry-you can stop it. In this guide, I’ll show you how to disable right-click and text selection in WordPress to help protect your content.

What It Means to Disable Right-Click and Text Selection

When someone right-clicks on your website, they usually see options like “Copy” or “Save image as.” Text selection means they can highlight and copy your words. By turning off these actions, you make it harder for people to copy your text or images.

It’s not a perfect solution-advanced users can still get around it-but it’s a useful way to discourage casual copying. Think of it as putting a “No Copying” sign on your site.

Disable Right-Click and Text Selection in WordPress

Why You Should Protect Your Content

Online, your writing, photos, and designs are valuable. If someone steals them, it can hurt your traffic, your brand, and even your sales.

For example:

  • A copied article could appear higher in Google than yours.
  • A stolen product photo could be used by someone else to sell the same thing.

By preventing easy copying, you encourage visitors to share your work properly instead of stealing it.

Ways to Disable Right-Click and Text Selection in WordPress

There are two main ways to do this- using a plugin or adding custom code.

1. Use a Plugin (Easiest Option)

If you’re new to WordPress, plugins are the simplest way to go. One of the best is WP Content Copy Protection & No Right Click.

Steps:

  1. Log in to your WordPress dashboard.
  2. Go to Plugins > Add New.
  3. Search for WP Content Copy Protection & No Right Click.
  4. Install and activate it.
  5. Open Settings > WP Content Copy Protection.
  6. Enable options to disable right-click and text selection.
  7. Save your settings.

Now visit your site and test it-you shouldn’t be able to right-click or highlight text.

Tip: This plugin also blocks keyboard shortcuts like Ctrl + C for copy.

2. Add Custom Code (Lightweight Option)

If you don’t want to use a plugin, you can do it with a small bit of code.

Steps:

  1. Back up your site first.
  2. Go to Appearance > Theme Editor.
  3. Open your functions.php file.
  4. Add this code at the bottom:
function disable_right_click() {
    ?>
    <script type="text/javascript">
        document.addEventListener('contextmenu', event => event.preventDefault());
        document.addEventListener('selectstart', event => event.preventDefault());
    </script>
    <?php
}
add_action('wp_head', 'disable_right_click');

5. Save the file and refresh your site.

That’s it-right-clicking and text selection should now be blocked.

3. Use a Script for More Control

If you want to disable copying only on certain parts of your site (like images), you can add a custom script.

Steps:

  1. Install a plugin like Insert Headers and Footers.
  2. Add this code inside the header section:
<script>
    document.oncontextmenu = () => false;
    document.onselectstart = () => false;
</script>

3. Save changes and test it.

Pros and Cons

Pros:

  • Helps stop casual content theft.
  • Encourages visitors to share instead of copying.
  • Easy to set up with or without plugins.

Cons:

  • Some users may find it annoying.
  • Not 100% secure-code-savvy users can still copy.
  • Can affect accessibility for screen readers.

Use it mainly for sites with valuable content like photos, recipes, or tutorials.

Also Read: How to Create Total Word Count Tools in WordPress

Final Thoughts

And that’s it! You now know how to disable right-click and text selection in WordPress. Whether you use a plugin or a bit of code, this small step can help protect your hard work from being copied too easily.

If this guide helped you, share it with your friends or leave a comment below. Protect your content-and keep creating great stuff!

Leave Your Comment