Your site had a good article but there's so many content scraper copy your content without link back to you? Well, I had a cool trick for you to block them from stealing your content. It's very simple.

I use a simple javascript event to block copy pasting content. There's so many javascript utility that you can find through the net but most of them had a long script, such as disable right click, disable text select, disable copy, disable keyboard shorcut, etc.

With this script your text could be read, but can't be select to copy it. Well, here is how to disable copy pasting to your site.



Open your template HTML then find <body> tag. Then add the following script to it. You can choose one of the script or use it all if you wish... :D
- onmousedown='return false;' = disable mousedown event (but not disable click event)
- onkeydown='return false;' = disable keyboard shortcut
- onselectstart='return false;' = disable text selecting
- oncontextmenu='return false;' = disable context menu (right click)
- oncopy='return false;' = disable clipboard

So, the final look of body tag if I only use onmousedown become like this: <body onmousedown='return false;'>
save your template.

So, is your content 100% protected? Unfortunately no....
Still not possible to make it 100% protected since the HTML code is open to everyone. At least this tips can make the content scraper harder to get content through your site.

As a bonus script, you can put NOSCRIPT tag to block access for javascript disabled browser:
<noscript>
<div style='width: 100%; height:100%; background: blue; text-align: center; position: fixed; top: 0px; z-index:100; left: 0px;'>
<h1>Javascript is disabled. Please enable javascript.</h1>
</div>
</noscript>

Hope this help. If you want more secure protection, you can try to encrypt your HTML code or use server side language such as PHP to hide your source code.
hi folks, visit my other tutorial blog at Kumpulan tutorial menarik
0 comments