{"id":2644,"date":"2012-05-01T09:22:07","date_gmt":"2012-05-01T09:22:07","guid":{"rendered":"http:\/\/2slick.com\/web\/?p=2644"},"modified":"2016-01-08T11:24:44","modified_gmt":"2016-01-08T11:24:44","slug":"disable-view-source","status":"publish","type":"post","link":"https:\/\/2slick.com\/web\/disable-view-source\/affordablewebsitestips\/tutorials","title":{"rendered":"Disable View Source"},"content":{"rendered":"<p>Can I stop people from copying my website our source code? The answer is no.<\/p>\n<p>I hear a lot of website owners complaining that their competitors are copying their website content. I have to tell them plain and simply, there's nothing they can do about it. If you have a website that's good enough to copy, people will do just that. It's extremely annoying I know.<\/p>\n<p>You can make it more difficult for these copycats to access your source code. You can disable the right&nbsp;mouse&nbsp;click view source code option. They will still be able to use the browser's menu to view the source code, but why not force them to take a few extra steps for spite?<\/p>\n<h3>How to disable View Source<\/h3>\n<ol>\n<li>Open your HTML document in your favorite editing program and enter this code in the header section:<!--DEVFMTCODE--><pre class=\"devcodeblock\" title=\"Javascript\"><table class=\"devcodetools\"><tbody><tr><td>&nbsp;Javascript&nbsp;|&nbsp;<\/td><td style=\"background-image:url('https:\/\/2slick.com\/web\/wp-content\/plugins\/devformatter\/img\/devformatter-copy.png');background-repeat:no-repeat;background-position:50% 50%;width:16px;height:16px;\"\/><embed id=\"ZeroClipboard1\" src=\"https:\/\/2slick.com\/web\/wp-content\/plugins\/devformatter\/_zclipboard.swf\" loop=\"false\" menu=\"false\" quality=\"best\" bgcolor=\"#ffffff\" width=\"16px\" height=\"16px\" align=\"middle\" allowScriptAccess=\"always\" allowFullScreen=\"false\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" flashvars=\"id=1&width=16&height=16\" wmode=\"transparent\" \/><\/td><td>&nbsp;copy&nbsp;code&nbsp;|<\/td><td style=\"cursor:pointer\" title=\"DevFormatter Plugin\" onclick=\"devfmt_credits()\">?<\/td><td width=\"99%\">&nbsp;<\/td><\/tr><\/tbody><\/table><div class=\"devcodeoverflow\"><table class=\"devcodearea\" width=\"100%\"><tr><td class=\"devcodelines\" width=\"1%\">01<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\"><span style=\"color: #339933;\">&lt;<\/span>SCRIPT TYPE<span style=\"color: #339933;\">=<\/span><span style=\"color: #3366CC;\">&quot;text\/javascript&quot;<\/span><span style=\"color: #339933;\">&gt;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines devcodelinesodd devcodelinesodd\" width=\"1%\">02<\/td><td class=\"devcodelinesarea devcodelinesareaodd devcodelinesareaodd\"><pre class=\"devcode devcodeline\"><span style=\"color: #003366; font-weight: bold;\">function<\/span> disableselect<span style=\"color: #009900;\">&#40;<\/span>e<span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines\" width=\"1%\">03<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\"><span style=\"color: #000066; font-weight: bold;\">return<\/span> <span style=\"color: #003366; font-weight: bold;\">false<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines devcodelinesodd devcodelinesodd\" width=\"1%\">04<\/td><td class=\"devcodelinesarea devcodelinesareaodd devcodelinesareaodd\"><pre class=\"devcode devcodeline\"><span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines\" width=\"1%\">05<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\"><span style=\"color: #003366; font-weight: bold;\">function<\/span> reEnable<span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines devcodelinesodd devcodelinesodd\" width=\"1%\">06<\/td><td class=\"devcodelinesarea devcodelinesareaodd devcodelinesareaodd\"><pre class=\"devcode devcodeline\"><span style=\"color: #000066; font-weight: bold;\">return<\/span> <span style=\"color: #003366; font-weight: bold;\">true<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines\" width=\"1%\">07<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\"><span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines devcodelinesodd devcodelinesodd\" width=\"1%\">08<\/td><td class=\"devcodelinesarea devcodelinesareaodd devcodelinesareaodd\"><pre class=\"devcode devcodeline\"><span style=\"color: #006600; font-style: italic;\">\/\/if IE4+<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines\" width=\"1%\">09<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\">document.<span style=\"color: #660066;\">onselectstart<\/span><span style=\"color: #339933;\">=<\/span><span style=\"color: #003366; font-weight: bold;\">new<\/span> <span style=\"color: #003366; font-weight: bold;\">Function<\/span> <span style=\"color: #009900;\">&#40;<\/span><span style=\"color: #3366CC;\">&quot;return false&quot;<\/span><span style=\"color: #009900;\">&#41;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines devcodelinesodd devcodelinesodd\" width=\"1%\">10<\/td><td class=\"devcodelinesarea devcodelinesareaodd devcodelinesareaodd\"><pre class=\"devcode devcodeline\"><span style=\"color: #006600; font-style: italic;\">\/\/if NS6<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines\" width=\"1%\">11<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\"><span style=\"color: #000066; font-weight: bold;\">if<\/span> <span style=\"color: #009900;\">&#40;<\/span>window.<span style=\"color: #660066;\">sidebar<\/span><span style=\"color: #009900;\">&#41;<\/span><span style=\"color: #009900;\">&#123;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines devcodelinesodd devcodelinesodd\" width=\"1%\">12<\/td><td class=\"devcodelinesarea devcodelinesareaodd devcodelinesareaodd\"><pre class=\"devcode devcodeline\">document.<span style=\"color: #660066;\">onmousedown<\/span><span style=\"color: #339933;\">=<\/span>disableselect<\/pre><\/td><\/tr><tr><td class=\"devcodelines\" width=\"1%\">13<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\">document.<span style=\"color: #660066;\">onclick<\/span><span style=\"color: #339933;\">=<\/span>reEnable<\/pre><\/td><\/tr><tr><td class=\"devcodelines devcodelinesodd devcodelinesodd\" width=\"1%\">14<\/td><td class=\"devcodelinesarea devcodelinesareaodd devcodelinesareaodd\"><pre class=\"devcode devcodeline\"><span style=\"color: #009900;\">&#125;<\/span><\/pre><\/td><\/tr><tr><td class=\"devcodelines\" width=\"1%\">15<\/td><td class=\"devcodelinesarea\"><pre class=\"devcode devcodeline\"><span style=\"color: #339933;\">&lt;\/<\/span>SCRIPT<span style=\"color: #339933;\">&gt;<\/span><\/pre><\/td><\/tr><\/table><\/div><\/pre><!--END_DEVFMTCODE--><\/li>\n<li>Save your&nbsp;document.<\/li>\n<li>If you have a WordPress website you can access your header code by logging into admin then clicking on 'Appearance' &gt; 'Editor' &gt; 'Header'. Don't forget to save your changes.<\/li>\n<li>Don't forget to save your changes.<\/li>\n<\/ol>\n<p>Again, this doesn't prevent visitors from viewing your source code using the browser's menu options, this only prevents visitors from viewing your webpage source code using the right mouse click view source option.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Can I stop people from copying my website our source code? The answer is no. I hear a lot of website owners complaining that their competitors are copying their website content. I have to tell them plain and simply, there&#8217;s nothing they can do about it. If you have a website that&#8217;s good enough to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,143,4],"tags":[340],"class_list":["post-2644","post","type-post","status-publish","format-standard","hentry","category-affordablewebsitestips","category-internet-tips","category-tutorials","tag-disable-view-source"],"_links":{"self":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts\/2644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/comments?post=2644"}],"version-history":[{"count":5,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts\/2644\/revisions"}],"predecessor-version":[{"id":9278,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/posts\/2644\/revisions\/9278"}],"wp:attachment":[{"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/media?parent=2644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/categories?post=2644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2slick.com\/web\/wp-json\/wp\/v2\/tags?post=2644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}