• Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
AnonyViet - English Version
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office
No Result
View All Result
AnonyViet - English Version
No Result
View All Result

How to hide HTML Code from others View Source

AnonyViet by AnonyViet
January 25, 2023
in Tips
0

You just wrote a great piece of HTML code, but you don’t want others to copy your source code. By some small tips below will help programmers hide HTML Code on their Website to avoid being copied by others.

Join the channel Telegram of the AnonyViet 👉 Link 👈

How to hide HTML Code from others View Source

How to hide HTML Code from others viewsource

Disable Ctrl and F12 keys with javascript

The F12 key is used to Open Chrome’s Developer Tools (Chrome Developer Tools). Chrome Developer Tools provides a set of tools that you can use to view the source code and behavior of a website.

Keys Ctrl mainly used in combination with other keys to view web source code.

Eg:

Ctrl + S: It is used to save the entire web page.

Ctrl + U: It is used to open the web source code in a new tab.

You can use this code in the script tag to disable the Ctrl and F12 keys.

document.addEventListener("keydown", function (event){
    if (event.ctrlKey){
       event.preventDefault();
    }
    if(event.keyCode == 123){
       event.preventDefault();
    }
});

Disable right click using javascript

By right clicking on the website, it will give you the option to view and inspect the source code of the website.

You can use this code in script tag to disable right click.

document.addEventListener(‘contextmenu’,
event => event.preventDefault()
);

More advanced techniques

The above two ways are great for those who are not very technical or for some beginners to learn programming.

How to hide HTML Code from others View Source 5

What about Web developers (technical experts)?

They can still view the web’s source code using a chrome extension, HTML blocker (BURP) or postman.

How to hide HTML Code from others View Source 6

So how to hide Source Code?

You cannot hide your HTML Code in your browser because your browser needs the HTML source code to run and view the web page.

However, here are some other techniques to minimize web scraping or source code duplication:

  • Use REACT JS to keep your code to a minimum.
  • Use server-side rendering to change the structure of your code over time.
  • Apply copyright act to legal action.
  • Enable SSL certificates to encrypt data between client and server side.

Conclusion

If you hide the HTML Code on the Website, Google’s crawlers can still read that code, but certain parts, such as No-Follow and No-Index, will tell the crawler whether to website indexing or not.

“Hidden text or links in your content to manipulate Google search rankings could be considered deceptive practice and violate the Google Webmaster Guidelines.”

You can hide data from users but not from crawlers, but now bots can read all the source code on your site.

Besides, I think hiding the HTML Code is not a good idea. You may face some SEO problems in the future.

The article achieved: 5/5 – (100 votes)

Tags: CodehideHTMLsourceview
Previous Post

Lesson 160: Lookup on the left in Excel

Next Post

Gaugan – Use AI to turn sketches into real photos

AnonyViet

AnonyViet

Related Posts

How to add sliders to Facebook Stories to easily rewind videos
Tips

How to add sliders to Facebook Stories to easily rewind videos

April 21, 2026
How to change the default font on Windows 10
Tips

How to change the default font on Windows 10

April 13, 2026
5 tips for using a Browser to replace an App (helps save RAM, time and money)
Tips

5 tips for using a Browser to replace an App (helps save RAM, time and money)

April 13, 2026
How to make funny MeMe photos without Photoshop within 10 seconds
Tips

How to make funny MeMe photos without Photoshop within 10 seconds

April 11, 2026
How to quickly design your own Logo without Photoshop
Tips

How to quickly design your own Logo without Photoshop

April 10, 2026
How to convert Website into App on Windows
Tips

How to convert Website into App on Windows

April 9, 2026
Next Post
Gaugan – Use AI to turn sketches into real photos

Gaugan - Use AI to turn sketches into real photos

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Recent News

Tips for pinning the step counter to the iPhone screen to monitor your health

Tips for pinning the step counter to the iPhone screen to monitor your health

April 28, 2026
How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

April 27, 2026
Instructions for looking up prescriptions on VNeID instead of paper medical books

Instructions for looking up prescriptions on VNeID instead of paper medical books

April 26, 2026
Tips to completely turn off CAPTCHA codes on iPhone and Mac are super simple

Tips to completely turn off CAPTCHA codes on iPhone and Mac are super simple

April 25, 2026
Tips for pinning the step counter to the iPhone screen to monitor your health

Tips for pinning the step counter to the iPhone screen to monitor your health

April 28, 2026
How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

April 27, 2026
Instructions for looking up prescriptions on VNeID instead of paper medical books

Instructions for looking up prescriptions on VNeID instead of paper medical books

April 26, 2026
AnonyViet - English Version

AnonyViet

AnonyViet is a website share knowledge that you have never learned in school!

We are ready to welcome your comments, as well as your articles sent to AnonyViet.

Follow Us

Contact:

Email: anonyviet.com[@]gmail.com

Main Website: https://anonyviet.com

Recent News

Tips for pinning the step counter to the iPhone screen to monitor your health

Tips for pinning the step counter to the iPhone screen to monitor your health

April 28, 2026
How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

How to turn off password suggestions on iPhone: Prevent Safari from auto-filling passwords

April 27, 2026
No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

wpDiscuz
0
0
Would love your thoughts, please comment.x
()
x
| Reply