-2

Can i hide my wordpress blog site's page source like this? I have to ask this question because there are many plugins which can disable page source and right-click. but after typing manually "view-source:url" in browser it instantly shows the source-code of wordpress site.If any body knows answer please write down . this is very important for all bloggers 'I think' .

GDhaduk
  • 45
  • 3

4 Answers4

3

TLDR: No, you can never hide the soure code of your page. There is NO way.


For a browser to render a web site you need to send it the HTML, CSS, and javascript code. Even though you can make it "harder" to see the code by disabling right click, anyone with just a little bit of understanding of the web will be able to read it easily (F12 in most browsers).

As a website designer it is important for you to understand this concept as it is very important in deciding on how to design your web site. Things the user should not see need to happen on the server side (where no user can reach it). Only things which dont matter if anyone can see should be sent to the user.

JensB
  • 6,663
  • 2
  • 55
  • 94
0

I think you cannot hide the whole code. Or do you want to hide a specific part of the code? For example, you can hide/encrypt the URL of an iframe in which you can display more sensitive content. However, I also don't really know how to do it in WordPress (I searched for a solution many times) but I heard it's possible.

I'm curious what about the answers.

Milosz
  • 118
  • 8
0

I wouldn't even consider doing this. Not only does it ruin the end-user's experience, it can actually stop people with disability copying text from your site or using other right-click menu items.

Jez Emery
  • 676
  • 4
  • 18
0

You can't hide your code, but you can obfuscate some of it.

  1. CSS Obfuscater.
  2. JSS Obfuscater.
Emil S. Jørgensen
  • 6,216
  • 1
  • 15
  • 28
  • I would however say most of this is quite useless as using the debug mode in most any browser makes it quite easy to see what is going on and you are really just introducing another level of things that can go wrong. Also relying on obfuscation for security is stupid, at most it is a slight annoyance. Better to design a web site so that it does not matter if anyone can see the source. – JensB Dec 02 '16 at 08:29
  • @JensB I didn't say to use this for security and neither did OP. I agree completely that security happens on the server, but if for some reason you want your code difficult to just copy from your site, then obfuscation might have some value for you. With obfuscated code it can be difficult to see which scripts are interacting with each other and therefore difficult to take out of context. – Emil S. Jørgensen Dec 02 '16 at 08:35
  • I'll agree to it making code harder to copy or understand without some extra work, but only slightly: heres a guide on how to deobfuscate JS: http://reverseengineering.stackexchange.com/questions/2103/try-to-deobfuscate-multi-layered-javascript I really can't think of a use case where this would be a good idea. At most its giving you a false sense of security. At best it making it harder for you to debug problems or find errors which might have been introduced as a result of the obfuscation. Also if anyone is interested enough to look at your code they can probably deobfuscate JS. – JensB Dec 02 '16 at 08:40