Title: hide source code to visitors
Last modified: August 20, 2016

---

# hide source code to visitors

 *  [mebox](https://wordpress.org/support/users/mebox/)
 * (@mebox)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/)
 * Hi guys,
 * Want to know is there anyway to hide the source code viewed to visitors ? And
   when i right click and click ‘ view source ‘ everything is visible, even the 
   file paths ‘ wp-content/themes ‘ etc . and even the CSS files visitors can access,
   even all the JS files used are accessible to anybody ( read only ) . So is there
   any good way to avoid people seeing such source code and CSS ?
 * Thanks,
    Mebox .

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586249)
 * Nope.
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586264)
 * So… the browser needs to be able to read your source code to parse it, to display
   a webpage.
 * If the browser can see it, people can see it.
 * If you hide it from people, you hide it from the browser…. and you don’t get 
   no web page!
 *  Thread Starter [mebox](https://wordpress.org/support/users/mebox/)
 * (@mebox)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586274)
 * Thanks for replies both ESMI and Voodoo .
 * But, want to know another thing . I have visited some of the wordpress sites 
   designed by big web design / development companies , and all of their source 
   codes are entirely different from what I designed . I know the source code is
   unique one for a development . But what I say is, when I right click and click‘
   view source ‘ , in their source, ‘ wp-content/themes/ … ‘ things are not there.
   Only the css styles, div ids and classes and etc are there .
 * But the case is entirely different when viewing the source code of my own theme
   design in my own website . Even when I use Twenty Eleven theme in my website .
   When I view the source, everything including file paths, directory paths are 
   shown . Even anybody can see what’s the theme used .
 * Can u please provide me with a solution ?
 * Thanks,
    Mebox .
 *  [uvray90](https://wordpress.org/support/users/uvray90/)
 * (@uvray90)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586517)
 * There is some method by using Javascript code obfuscation. For WP I don’t know.
   For basic HTML webpages I had done this. Its like when you view source code it
   gives weird code. [http://htmlobfuscator.com/](http://htmlobfuscator.com/) Try
   it out. If anyone gets a way or any clue for using this in WP then kindly update.
 *  [uvray90](https://wordpress.org/support/users/uvray90/)
 * (@uvray90)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586518)
 *     ```
       <?php
       	function strToHex($string)
       		{
           		$hex='';
           		for ($i=0; $i < strlen($string); $i++)
           		{
               		$hex .= "%".dechex(ord($string[$i]));
           		}
   
           		return $hex;
       		}
   
       	$message	 = "<h2>UVray90</h2>";
       	$encoded	 = strToHex($message);
        	?>
   
       <script language="javascript">
       document.write( unescape( '<?php echo $encoded ?>' ) );
       </script>
       ```
   
 *  [uvray90](https://wordpress.org/support/users/uvray90/)
 * (@uvray90)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586519)
 * Try out this bit of code and use the view source code option. It gets the job
   done for normal use although its not secure or something. I am not good at WP
   coding. Any nice guys here can get this developed into a pretty good plugin(Maybe
   there already is one). Do tell me if this is a blunder. 🙂 Cheers.
 *  [vechnost](https://wordpress.org/support/users/vechnost/)
 * (@vechnost)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586522)
 * and where to put this code in?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 5 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586523)
 * Vechnost, create your own thread on this issue. If necessary, refer this thread.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘hide source code to visitors’ is closed to new replies.

## Tags

 * [hide css](https://wordpress.org/support/topic-tag/hide-css/)
 * [how-to](https://wordpress.org/support/topic-tag/how-to/)
 * [source-code](https://wordpress.org/support/topic-tag/source-code/)

 * 8 replies
 * 6 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/hide-source-code-to-visitors/#post-2586523)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
