Top

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. :)

Tweet This Post

Comments

Got something to say?

Bottom
Article Archive  |  This site is a historical archive of pressography.com, a WordPress plugin and theme blog that published between 2006 and 2012. It is preserved for reference and is not operated by, affiliated with, or endorsed by its original authors. Nothing here is for sale and no form on this site is active. If you are the original owner and would like this domain returned, please get in touch.