{"id":21979,"date":"2020-12-30T11:16:19","date_gmt":"2020-12-30T09:16:19","guid":{"rendered":"https:\/\/www.reliablesoft.net\/?p=21979"},"modified":"2021-06-23T19:10:19","modified_gmt":"2021-06-23T16:10:19","slug":"view-source-code","status":"publish","type":"post","link":"https:\/\/www.reliablesoft.net\/view-source-code\/","title":{"rendered":"How to See the Source Code of a Website (Easy Methods)"},"content":{"rendered":"

It\u2019s always useful to know how to view the source code of your website or any website. It\u2019s a skill that can prove very handy when working on your SEO, troubleshooting problems, or just curious to see how the HTML source code of a website looks like.<\/p>\n

In this post, you\u2019ll learn easy methods on how to see the code of any website on any platform. Let\u2019s get started.<\/p>\n

How to view the HTML source code of a website on a Mac<\/h2>\n

Safari<\/strong><\/p>\n

To view the source of a website on a Mac using Safari, navigate to the page you want and use the following keyboard shortcut: Option+Command+U.<\/p>\n

Alternatively, you can right-click anywhere on the page and select \u201cShow Page Source\u201d from the dropdown menu.<\/p>\n

\"View
View Source Code on a Mac<\/figcaption><\/figure>\n

Google Chrome<\/strong><\/p>\n

To view the source code of a website on a Mac using Chrome, navigate to the page you want and use the keyboard shortcut: Option+Command+U.<\/p>\n

You can also right-click on the page and select \u201cView Page Source\u201d from the dropdown menu.<\/p>\n

\"View
View Website Source Code Using Chrome on a Mac<\/figcaption><\/figure>\n

Firefox<\/strong><\/p>\n

When using Firefox on a Mac, the keyboard shortcut to view the source code is: COMMAND + U<\/p>\n

A keyboard shortcut is a combination of keys you need to press at the same time to execute a specific command. In this case, the keyboard shortcuts will help you view the source of a website without having to go through the menu options.<\/div>\n

How to view source code on a PC<\/h2>\n

Google Chrome<\/strong><\/p>\n

When using Google Chrome on a PC, you can view the source code of a website by using the keyboard shortcut: CTRL + U.<\/p>\n

\"View
View Source Code Using Chrome on a PC<\/figcaption><\/figure>\n

Firefox<\/strong><\/p>\n

When using Firefox on a PC, the keyboard shortcut to view the source code is: CTRL + U<\/p>\n

Opera<\/strong><\/p>\n

When using Opera on a PC, the keyboard shortcut to view the HTML source code of a page is: CTRL + U<\/p>\n

Microsoft Edge<\/strong><\/p>\n

The keyboard shortcut to view the source code of a page when using Microsoft Edge browser on a PC is: F12 & CTRL+SHIFT+I<\/p>\n

How to view the HTML code of a particular page element?<\/h2>\n

Instead of viewing the HTML code of a whole page, you can view the code of particular page elements using the INSPECT ELEMENT option available in all popular browsers like Google Chrome, Firefox, and Safari.<\/p>\n

The process is straightforward. Open the page in a new browser window and then highlight a section of the page using the mouse.<\/p>\n

Right-click and then select INSPECT from the dropdown menu.<\/p>\n

This will open the developer tools and show you the HTML code associated with the particular element or page section.<\/p>\n

Here is a quick demo on how to do this using Google Chrome.<\/p>\n

\"View
View the code of a page element using INSPECT.<\/figcaption><\/figure>\n

How to download an entire website source code?<\/h2>\n

To download a website’s HTML source code, navigate using your favorite browser to the page, and then select SAVE PAGE AS from the FILE menu. You’ll then be prompted to select whether you want to download the whole page (including images) or just the source code.<\/p>\n

The download options are common for all browsers.<\/p>\n

Web Page, Complete:\u00a0<\/strong>Downloads the page source code and all images, CSS files, and js script associated with the particular page. All files are saved in a folder. This is useful when you need to download the images together with the HTML code.<\/p>\n

Web Page, Single File:\u00a0<\/strong>Downloads the page in MHTML (short for MIME HTML). This is a form of HTML that includes both the website’s code and any external resources.<\/p>\n

Web Page, HTML Only:\u00a0<\/strong>Downloads the HTML and any other elements (like embedded Java Script Code) found in the body of a page.<\/p>\n

Why is important to know how to view a websites\u2019 source code?<\/h2>\n

There are many use cases where you might want to check the source code of a website, the most common are:<\/p>\n

Check for the occurrence of H1 tags<\/strong> – Best SEO practices indicate a page should have only one H1 tag<\/strong><\/a>. To check if this is the case with your website, you can navigate to one of your posts, and using any of the methods described above, you can view the HTML source code of the page. You can then search for <h1> and see if there is more than one H1 tag on the page.<\/p>\n

Check if links are nofollow<\/strong> – One of the ways to find out if a link has the nofollow<\/em> tag<\/strong><\/a> added (which makes it less important for SEO rankings) is to view the HTML code of a page and check for the occurrence of the word ‘nofollow’ within the <a><\/a> element. You can do this to check the links on your website or any other website.<\/p>\n

Optimize your website for speed<\/strong> – A good reason for analyzing your website’s source code is when optimizing your page speed<\/strong><\/a>. As a starting point, you can view the HTML of a page and try to identify elements (including JS and CSS files) that can be removed to make the page size smaller and faster to download. Then with the help of other tools (like Google’s PageSpeed Insights<\/strong><\/a>), you can continue optimizing your code further.<\/p>\n

\n

Key Learnings<\/h2>\n

It’s very easy to view or save the source code of a webpage. The process is the same for all browsers. The first step is to navigate to the page you want and then you can view the HTML using a keyboard shortcut.<\/p>\n

You can optionally download the code in a text file. To view the HTML code of a particular page element, use the INSPECT function that is part of the developer’s tools.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

It\u2019s always useful to know how to view the source code of your website or any website. It\u2019s a skill that can prove very handy when working on your SEO, troubleshooting problems, or just curious to see how the HTML source code of a website looks like. In this post, you\u2019ll learn easy methods on […]<\/p>\n","protected":false},"author":2,"featured_media":21985,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","mc4wp_mailchimp_campaign":[]},"categories":[493],"tags":[685,684],"_links":{"self":[{"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/posts\/21979"}],"collection":[{"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/comments?post=21979"}],"version-history":[{"count":20,"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/posts\/21979\/revisions"}],"predecessor-version":[{"id":29007,"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/posts\/21979\/revisions\/29007"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/media\/21985"}],"wp:attachment":[{"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/media?parent=21979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/categories?post=21979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reliablesoft.net\/wp-json\/wp\/v2\/tags?post=21979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}