-2

I have inserted my javascripts in the header.php file, but I noticed the whole code can be stolen by simply lookin at the source from within any single post or homepage...

May you suggest me a simple way to hide my javascripts in wordpress somehow to prevent being copied/stolen?

  • 2
    Can't be done. JavaScript runs on the client and therefore must be visible – Andreas Jun 08 '17 at 11:44
  • It can however be uglified, makes it less readable – Brian Jun 08 '17 at 11:45
  • 1
    @Andreas let me correct myself then. *even less readable – Brian Jun 08 '17 at 11:46
  • Haha! But to OP. You can include the JavaScript file in the source and that makes only a link to the file visible, but still anyone that wants to read it can read it by opening the file – Andreas Jun 08 '17 at 11:48

2 Answers2

3

You can't hide javascript. Client always need to access it.

kRicha
  • 797
  • 9
  • 27
1

You can minify and uglyfy your code, so it will be hard to read it

btx
  • 1,972
  • 3
  • 24
  • 36