How do I disable right click functions.

Joined: 01/18/2009
User offline. Last seen 19 weeks 5 days ago.

I would like to know how do i disable the right click functions for a wordpress site.

G&G Moderator
EdRoss's picture
Joined: 10/05/2006
User offline. Last seen 8 weeks 4 days ago.
re: How do I disable right click functions

Are you asking: How do I stop a user right-clicking on a web page (made with Wordpress), so they do not see the menu that would normally appear after right-clicking on a web page?

G&G Podcast Host
Matt Farina's picture
Joined: 06/01/2006
User offline. Last seen 21 weeks 6 days ago.
JavaScript

With JavaScript you can capture the right click event and act on it. Depends what you want to do. Have it display a message, have it do nothing, or something else.

Out of curiosity, why do you want to disable it?

Matt Farina
Geeks and God Former Co-Host
www.mattfarina.com

G&G Moderator
EdRoss's picture
Joined: 10/05/2006
User offline. Last seen 8 weeks 4 days ago.
If you are trying to stop

If you are trying to stop people viewing your source code, you are going to have to do more than disable right clicking on your site. There are tools such as cURL that let a user download the source code of a web page without even needing to use a web browser.