skip to Main Content

How to Disable Copy Paste in WordPress (Step by Step Guide)

On many websites, you might have noticed that the content cannot be copied or selected. Even when you right-click, options like copy, cut, or paste do not appear. In this tutorial, we will learn how to disable copy paste in WordPress easily without using any plugin.

Let’s get started.

Step 1: Login to Your WordPress Admin Panel

First, log in to your WordPress dashboard with your admin credentials.

Step 2: Go to Theme File Editor

From the left sidebar, click on Appearance → Theme File Editor.

How to Disable Copy Paste in WordPress (No Plugin Needed)

Step 3: Open the functions.php File

On the right sidebar, click on the functions.php file of your active theme.

How to Disable Copy Paste in WordPress (No Plugin Needed)

Step 4: Add the Code

Scroll to the very bottom of the file and paste the following code. Finally, click on Update File.

/**
 * Disable Right Click, Copy, Cut & Paste on Frontend
 */
function nahian_disable_copy_paste() {
?>
<script>
document.addEventListener("DOMContentLoaded", function() {
    // Blocked events list
    ["contextmenu", "copy", "cut", "paste"].forEach(function(evt) {
        document.addEventListener(evt, function(e) {
            e.preventDefault();
        });
    });
});
</script>
<?php
}
// Hook into wp_head so that script loads on every frontend page
add_action( 'wp_head', 'nahian_disable_copy_paste');

How to Disable Copy Paste in WordPress (No Plugin Needed)

Step 5: Done!

That’s it. Now, no one will be able to copy or right-click on your website content.

Important Note

Before making any changes, it is always recommended to take a backup of your theme to avoid unwanted issues.

✅ With this simple method, you have successfully learned how to disable copy paste in WordPress and protect your valuable content from being copied.

 

Latest Articles
October 9, 2026

Resolving the ‘Can NOT Find LSCWP Path for Object Cache Initialization’ Error on Your WordPress Site

Seeing the message "Can NOT find LSCWP path for object cache initialization in /home/cP_username/html/wp-content/object-cache.php" on your WordPress dashboard can be…

Subscribe To Our Newsletter

Don't get left out of the loop, make sure you subscribe to our newsletter below so you can be notified of our latest insights, tips, tutorials, sales and more!

Discussion
Back To Top