A frequent question we get from our Writing HTML tutorial is:

“what code can I use to prevent people from viewing/stealing the source code of my web pages?”

and the answer is very similar to what i say to people when they want to protect their images on web pages from being stolen- if you do not want someone out there to “steal” your web images– keep them off the internet. All of the techniques out there, JavaScript disabling of right mouse clicks is baby stuff to circumvent.

But rather than respond with my own tirade, I typically gently suggest that it is more trouble than it is worth, and seed them with a good google link for reference resources, for the above question:

Top of that is a great site from Vortex Designs, How to prevent theft of your source code!, that starts with this bit of humor:

Here are a number of very effective methods of keeping unscrupulous surfers from stealing your HTML source:

1. Use the <INVISIBLE> </INVISIBLE> tags around the entire document.
2. Use the DONTSTEAL attribute in the <BODY> tag.
3. Ftp to your server, select all files and directories, hit “Delete”.
4. Put every existing copy of every file on floppies, place them in a shoebox and bury them in the backyard. There is another version of this method which involves placing the floppies in a plastic bag and hiding them in a different sort of hole. Both are equally effective.
5. Password protect your entire site and make sure no one has the password, not even you.
6. Employ a small but fanatically loyal and well-armed band of mercenaries to guard your site.
7. Start>Run>format C:\
8. Attack dogs, preferably rabid.
9. Use any version of Microsoft Frontpage to create your site. (This won’t prevent people from viewing your source, but no one will want to steal it.)
10. Don’t put your pages on the web.

but then gets down to business shooting holes in most of the typical suggested methods.

There are design elements I may emulate, copy a method, but how rare would it be that another site would have all of the information elements that one would even need to “steal” it all? It has yet to happen.

In more than 10 years of looking at web sites, I am hard pressed to think of many sites worth “stealing” the code from, although I regularly poke around source code to get ideas on how some sites do their designs. It is how I learn the most, but I have never found a piece of source code that I could use by outright copying. It is against my own philosophy of a shared network of knowledge to try and put the web page designs behind a barbed wire fence.

But if you need some good HTML attack dogs (method 8), let me know- we deliver.

If this kind of stuff has any value, please support me monthly on Patreon or a one time PayPal kibble toss
Profile Picture for Alan Levine aka CogDog
An early 90s builder of the web and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person.


Comments are closed.