Stop end user printing and editing

What is the code for stopping the end user from printing or (mainly) editing the content of any web page through view/source or page source. Is the code put in the body or in the head. Thanks for any help.

Can I use this coding for both Online and offline pages?


The only way to stop people printing or copying your site is not to publish it on the web, or to require authentication and only give passwords to people you trust. Once you make it public, people will be able to copy it (even if it’s as simple as taking a screenshot). Making it harder for people to print and copy will make the website difficult and frustrating to use. And quite frankly, the harder you make it, the more determined some people will be to copy it and republish it - and their site will be more user-friendly and accessible, so Google will start sending people to them instead of you.

Well other that AJAXing the whole page ( using javascript to write the page dynamically ) I don’t think this is possible. By it’s very definition a good web page allows its user to copy/paste its content . This, BTW, doesnt mean they are ALTERING your page… just merely that they have copied its content or by using view-source… your code.

I you dont want content to be copied and do not want to AJAX… you could build the site in FLASH. You cant copy paste from flash unless YOU enable it in your SWF file and people viewing the source HTML would essentially see just a link to your file and nothing else and as SWF are not easily decompiled… your FLASH page cant be downloaded/copied for altering purposes.

All that being said… since your content wont be able to be scanned via the source code… search engines will not like you.

Actually, even that doesn’t work. You either provide the client side code to the browser to be rendered in some form (whether staticly as HTML and CSS files or dynamically as Javascript) or you don’t. And if you don’t, then the browser has absolutely nothing to render. There is no way around that without simply serving a blank page.

However, if you’re serious, you don’t want web development, you want desktop application development. That allows you to compile everything into binary files like dll libraries and it’s virtually impossible to make any use of that to recover the original code.