How to disable right click in your website with one click

In this article, I will show you how you can block or disable the right click in your blogger or WordPress website to make your site more secure with an easy one liner code. 

This code will disallow the users to copy your content and even your websites code from an inspect element, because any user can see your websites code easily via inspect element so its really important to secure your website and avoid users to copy anything from website.

So, without any delay lets check this simple process fast.

To disable the right click in your website open your blogger's website dashboard and then go to the Theme section and click edit HTML and then search for <html tag, it will be mostly at the top of the code but if you don't find then press control +F to find exact value you want to find.

Note: before you do any changes to your websites theme make sure to take back-up first!


Now search for <html tag and paste this code oncontextmenu='return false'  just after the html. 


Now save your html code and refresh your website to see the results. After refreshing your website you will see right click option disabled and now no one can copy your content. You can anytime enable it, just remove the code where you pasted it.

How to disable right click in WordPress website?

Open your WordPress website dashboard and go to the appearance then go to the Theme file editor and search the header.php, click on it as you find then you will see a page with code at your left and there you have to find the <html tag it will be before the head tag when you find it just paste the above code just after the html tag and save your code. So, it's done now. Refresh your website to see the results.

I hope you find this article helpful and got the thing for what you came here but still if you didn't get what you want then fell free to contact me Here

Author Avatar

Saqib Bedar 

Hi!👋I'm Saqib Bedar from Pakistan. I'm a passionate frontend developer from Pakistan. Currently, I'm working as a student in Pakistan. Know more about me →

Buy me Coffee