Quick Guide On How To Access Website Source Code
Open any page's raw HTML with Ctrl/Cmd+U or the view-source: prefix in your address bar. Use DevTools (F12) for live inspection of rendered DOM, CSS, and network requests. Five things worth checking for SEO: title tags, meta descriptions, H1 headings, image alt attributes, and analytics tracking snippets.
Every Wednesday. 28,400+ operators. Zero fluff.
✓ Check your inbox — click the confirmation link to complete sign-up.
✓ You're subscribed!
✓ You're already on the list.
Table of contents
Open Table of contents
How to View Source Code
There are two distinct tools here. Know which one to reach for:
- View Source (
view-source:/Ctrl+U/Cmd+U) — shows the raw HTML the server sent. Fast, read-only, great for quickly scanning<head>metadata. - DevTools (
F12/Cmd+Option+I) — shows the live DOM after JavaScript has run. Use this when a framework (React, Next.js, Astro, etc.) renders content client-side and the raw HTML is nearly empty.
Most modern sites are partially or fully JavaScript-rendered, so DevTools is where I spend most of my time.
The view-source: shortcut (all browsers)
Type view-source: directly before any URL in the address bar — e.g., view-source:https://example.com — and press Enter. This works in Chrome, Firefox, Edge, and Opera. Safari requires enabling the Develop menu first (see below).
PC keyboard shortcuts
Chrome (Windows / Linux)
- View Source:
Ctrl+U - DevTools:
F12orCtrl+Shift+I - Or: right-click → View Page Source / Inspect
Firefox (Windows / Linux)
- View Source:
Ctrl+U - DevTools:
F12orCtrl+Shift+I - Or: right-click → View Page Source / Inspect
Microsoft Edge (Windows)
- View Source:
Ctrl+U - DevTools:
F12orCtrl+Shift+I - Or: right-click → View Page Source / Inspect
Opera (Windows / Linux)
- View Source:
Ctrl+U - DevTools:
Ctrl+Shift+I - Or: right-click → View Page Source
Mac keyboard shortcuts
Chrome (macOS)
- View Source:
Cmd+Option+U - DevTools:
Cmd+Option+I - Or: View → Developer → View Source; right-click → View Page Source / Inspect
Firefox (macOS)
- View Source:
Cmd+U - DevTools:
Cmd+Option+IorF12 - Or: right-click → View Page Source / Inspect
Safari (macOS)
Safari hides developer tools by default. Enable them once:
- Open Safari → Settings (or Preferences on older macOS) → Advanced tab.
- Check “Show features for web developers” (replaces the old “Show Develop menu” checkbox as of Safari 17).
- Now Develop → Show Page Source (
Cmd+Option+U) and Develop → Show Web Inspector (Cmd+Option+I) are available. Right-click → Inspect Element also works.
Microsoft Edge (macOS)
- View Source:
Cmd+Option+U - DevTools:
Cmd+Option+IorF12
Mobile
- Android Chrome: Type
view-source:before the URL in the address bar. For DevTools, connect via USB and usechrome://inspecton a desktop Chrome instance (remote debugging). - iOS Safari: Remote debugging via Safari on a Mac: Settings → Safari → Advanced → Web Inspector on the device, then Develop → [your device] in desktop Safari.
- Mobile browsers do not expose a native DevTools panel on-device — remote debugging is the practical path.
Important SEO Elements To Check
Once you can view source, use Ctrl+F / Cmd+F to search the raw HTML for the snippets below.
1. Title Tags
Search for <title. Each page should have exactly one, and the text inside it should be unique across your site. Title tags are the single most important on-page signal for telling both users and search engines what a page is about. Duplicate or missing title tags are among the most common SEO mistakes I find during audits.
2. Meta Descriptions
Search for <meta name="description". The content attribute is the snippet Google often shows in search results — keep it under roughly 160 characters. It is not a direct ranking factor, but it drives click-through rate, which matters. Check that no two pages share the same description.
3. H1 Headings
Search for <h1. Best practice is one H1 per page. It should describe the main topic clearly and include your primary keyword naturally. Stuffing multiple keywords into the H1 reads as spam to both users and algorithms.
4. Image Alt Tags
Search for <img. Each image should have an alt attribute that describes its content. Alt text is what screen readers announce to visually impaired users, and it is the only signal search engines have for understanding image content. Missing alt tags are easy wins — flag them and fill them in.
5. Analytics Tracking Code
Search for your GA4 measurement ID (format: G-XXXXXXXXXX) or Google Tag Manager container ID (GTM-XXXXXXX). If you are using the older Universal Analytics UA- format, note that Google shut down standard UA properties in July 2023 — those IDs are no longer collecting data. Verify you have migrated to GA4 or an alternative (Plausible, Fathom, PostHog, etc.).
Reasons to Read a Website’s Source Code
You do not need to be a developer to get value from this skill. Here are the main reasons I return to it:
1. Verify Meta Robots Tags
A single misplaced <meta name="robots" content="noindex"> will silently de-index a page. Search the source for robots to confirm you are not accidentally blocking pages from being crawled.
2. Audit Heading Structure
Good heading hierarchy (H1 → H2 → H3) helps both accessibility and SEO. A quick view-source scan shows whether headings are nested logically or whether someone has used H tags purely for styling.
3. Check Image Optimization
Beyond alt tags, look at the src attribute. Are images served from a CDN? Are they modern formats (WebP, AVIF)? Are width and height attributes set (prevents layout shift)? These details show up clearly in source.
4. Spot Hidden or Injected Content
Occasionally a plugin, third-party script, or bad actor injects content into a page that is invisible in the rendered view but visible to search engines. Common patterns: display:none divs stuffed with keyword spam, links hidden off-screen, or text matching the background color. A raw source scan will surface these.
5. Validate Internal Link Structure
Search for <a href= and scan the link targets. Broken relative paths, accidentally nofollow-ed internal links, or redirect chains inside the site hierarchy can silently drain PageRank. View Source is faster than waiting for a full Screaming Frog crawl when you just need a quick check.
Bottom line
Viewing source is a thirty-second habit that catches expensive SEO problems before they compound. Whether you use Ctrl+U for the raw HTML or DevTools for the live DOM depends on whether the page is server-rendered or JavaScript-rendered — for most 2026 sites you need both.
Check out these articles you might find useful for SEO:
- How To Use SEO As A Strategy To Create Site Structures?
- Surfer SEO Review: Features, Pricing, Pros & Cons
- How to Create Search Engine Friendly Tags
Viewing Website Source Code — 2026 FAQ
Does view-source still work on JavaScript-rendered sites?
Partially. view-source: shows the HTML the server sent — which for React, Next.js, Astro (client-only), or similar frameworks is often a near-empty shell with script tags. The rendered content lives in the live DOM, which you access via DevTools → Elements panel. For server-side rendered (SSR) or statically generated sites, view-source: shows the full page content because the HTML is complete before it reaches the browser.
Can I view source on a page that requires login?
Yes, as long as your browser session is authenticated. view-source: and DevTools both operate on whatever the browser already has loaded. If you can see the page, you can inspect its source. You cannot view source of a page you have not loaded.
Is viewing someone else’s source code legal?
In virtually every jurisdiction, reading HTML that a web server voluntarily sends to your browser is legal — the server chose to transmit it. Automated scraping at scale, bypassing access controls (e.g., circumventing a paywall), or using the source code commercially without a license are separate questions with different legal answers. For routine SEO audits and competitive research, reading publicly served source is standard and uncontroversial.
What is the fastest way to check if a site uses a specific technology in 2026?
Three options: (1) check the source for tell-tale strings (e.g., __NEXT_DATA__ for Next.js, astro-island for Astro, wp-content for WordPress); (2) install the Wappalyzer browser extension, which identifies frameworks, CDNs, analytics tools, and as of 2025 some AI stack components (LangChain, LlamaIndex); (3) run the URL through BuiltWith for a detailed tech stack report.
Related reading:
- How To Use SEO As A Strategy To Create Site Structures?
- How to Create Search Engine Friendly Tags
- Surfer SEO Review: Features, Pricing, Pros & Cons
This guide is part of alejandrorioja.com — written by Alejandro Rioja, who now builds AI agent systems for founders. Including the agent that keeps this site current. How it works →
Updated for May 2026
A couple of 2026 updates to the specific advice in this post:
- HTTPS / connection errors in 2026 browsers: Chrome 130+ and Firefox 130+ both default to HTTPS-only mode, so “your connection is not private” errors are more common — usually a Let’s Encrypt cert misconfig or an expired root. Fix is the same as in the post; the visible UI differs.
- GoDaddy email: the legacy Workspace Email product was migrated to Microsoft 365 for most accounts during 2024–25. If the post references the old IMAP settings, double-check against the M365 endpoints (
outlook.office365.com). - Z-Library continued operating from rotating mirrors and the Anna’s Archive umbrella through 2024–26 despite ongoing DOJ enforcement. The legal landscape is unresolved.
- Website source code still inspected the same way — DevTools, View Source, and Wappalyzer for stack identification. Wappalyzer added AI-stack detection in 2025 (LangChain, LlamaIndex, etc.).
Every Wednesday. 28,400+ operators. Zero fluff.
✓ Check your inbox — click the confirmation link to complete sign-up.
✓ You're subscribed!
✓ You're already on the list.
Get the AI playbook in your inbox
Every Wednesday. 28,400+ operators. Zero fluff.
Check your inbox.
We sent you a confirmation email — click the link inside to complete your subscription. Check spam if you don't see it within a minute.
You're subscribed.
Welcome — the next edition lands in your inbox soon.
You're already on the list — look for it every Wednesday.