0

Can I hide the code of html + javascript of wordpress pages ? I mean when anyone hits view source he/she will not able to know that the website was developed using WordPress ?

Amer Enaya
  • 39
  • 2
  • 8

4 Answers4

2

It is not possible to prevent a user from viewing the source of a website. The web browser needs to be able to render it, so any form of "encryption" would cause the browser to miss-render the page.

There are HTML obfuscation tools online such as this. But you would not be able to use them in WordPress as it generates all it's HTML on the fly.

Rather than hiding the fact that you are using WordPress I would suggest that you ensure your WP install is kept up-to date and that you use sensible security plugins such as Bulletproof Security.

melodiouscode
  • 2,105
  • 1
  • 20
  • 41
1

If you simply want to remove the <meta name="generator" content="WordPress 3.4.1" /> tag from your generated HTML, you can add this in your theme's functions.php.

remove_action('wp_head', 'wp_generator');

If you want to remove the "Powered by WordPress" in the footer text, that'll depend the theme you're using. Some themes allow you to customize the footer text from the dashboard, others will need manual modifications in the footer.php.

It will probably still be obvious that you're using WordPress though. A lot of references to uploaded files inside wp-content will be visible and many class names will have the wp- prefix. You probably won't be able to change those without breaking your website.

In general, you can't stop users from viewing the source of your website. The HTML is what defines the markup and content of your website, and the browser simply renders it. The best you can do is obfuscate it in such way that you can't easily tell what each HTML element represents or what each JavaScript function does.

Mattias Buelens
  • 19,609
  • 4
  • 45
  • 51
0

No it's not possible. It'll will always be possible to see it since the browser has to get it in plain text to render it.

Look at JavaScript obfuscation to make your code harder to reuse or understand : How can I obfuscate (protect) JavaScript?

Community
  • 1
  • 1
AsTeR
  • 7,247
  • 14
  • 60
  • 99
0

I believe what you're trying to do is hide the fact that your site is powered by WordPress. For that, you can try the suggestions presented here: How to Hide WordPress Info from Your Source Code