1. Home
  2. Security
  3. Disable Right-Clicking on Your Website

Disable Right-Clicking on Your Website

To add an extra layer of security to your website, you can add this code to disable right-clicking on your website to make it a little harder to view the source code.

Instructions

In the steps below, you will add code to a widget that appears on every page of your website.

1. In WordPress, click Widgets under Appearance on the sidebar.

Screen Shot 2014-04-29 at 7.15.50 PM

2. If you are using footer widgets, copy and paste the code below into one of the Text widgets at the bottom of whatever code you have in a text widget and click the save button.

<script type="text/javascript">
$(document).ready(function(){  $(document).bind("contextmenu",function(e){ return false; }); });
</script>

Example image:

Screen Shot 2014-04-29 at 7.21.35 PM

Suppose you aren’t using footer widgets. Paste the code above into a text widget under your other code on both the Single Beats Sidebar and the Beat Store & Genre Sidebar sidebar options.

Updated on March 11, 2025

Was this article helpful?

Related Articles


Need Help?

1. Try searching for answers. Try searching different terms if you can't find a answer. 2. Try troubleshooting if something is not working.

3. If you can't find answers, click to leave a comment. Provide website links and detailed information.