Daily Tip: How to Disable Right-Clicking on Your WordPress Blog
April 17, 2010
If you have a lot of copyrighted images or you don’t want people stealing parts of your design, here’s a quick way to disable right-clicking within WordPress. There are plugins that will do this for you, but I think this is easier than installing a plugin. Open your header.php file and add this jQuery snippet right before the closing < /head> tag:
<script type="text/javascript"> $(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; }); }); </script>
Save the changes. Now test right-clicking on your images. Nothing happens. That’s how you can tell it’s working. :)



Comments
Got something to say?