• 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

Instructions for creating Minecraft-style food photos
Tips

Instructions for creating Minecraft-style food photos

June 9, 2026
Get free Cambridge courses to prepare for IELTS, Starters, Movers
Tips

Get free Cambridge courses to prepare for IELTS, Starters, Movers

June 4, 2026
How to record reaction videos with Android phones, no app needed
Tips

How to record reaction videos with Android phones, no app needed

June 1, 2026
Instructions on how to get Google AI Pro 1 year for free for new accounts
Tips

Instructions on how to get Google AI Pro 1 year for free for new accounts

June 1, 2026
Top free AI tools to help write, test and optimize content
Tips

Top free AI tools to help write, test and optimize content

June 1, 2026
Instructions for receiving Lovable Pro 12 months for free
Tips

Instructions for receiving Lovable Pro 12 months for free

May 29, 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

Cách làm mờ khuôn mặt trên iPhone, không cần tải app

Cách làm mờ khuôn mặt trên iPhone, không cần tải app

June 11, 2026
Website to check the World Cup 2026 match schedule intuitively, with automatic calendar synchronization

Website to check the World Cup 2026 match schedule intuitively, with automatic calendar synchronization

June 11, 2026
PDF editing application on Android worth 199k is free

PDF editing application on Android worth 199k is free

June 10, 2026
Instructions for creating Minecraft-style food photos

Instructions for creating Minecraft-style food photos

June 9, 2026
Cách làm mờ khuôn mặt trên iPhone, không cần tải app

Cách làm mờ khuôn mặt trên iPhone, không cần tải app

June 11, 2026
Website to check the World Cup 2026 match schedule intuitively, with automatic calendar synchronization

Website to check the World Cup 2026 match schedule intuitively, with automatic calendar synchronization

June 11, 2026
PDF editing application on Android worth 199k is free

PDF editing application on Android worth 199k is free

June 10, 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

Cách làm mờ khuôn mặt trên iPhone, không cần tải app

Cách làm mờ khuôn mặt trên iPhone, không cần tải app

June 11, 2026
Website to check the World Cup 2026 match schedule intuitively, with automatic calendar synchronization

Website to check the World Cup 2026 match schedule intuitively, with automatic calendar synchronization

June 11, 2026
  • Home
  • Home 2
  • Home 3
  • Home 4
  • Home 5
  • Home 6
  • Next Dest Page
  • Sample Page

6789 kv999

No Result
View All Result
  • Home
  • News
  • Software
  • Knowledge
  • MMO
  • Tips
  • Security
  • Network
  • Office

6789 kv999

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