Skip to content
Searchpedia SEO field notes Callum Bennett Callum

Site ops

SEO Code

SEO code is the HTML, CSS, JavaScript, and structured data in a page's source that helps search engines crawl, understand, and index content more effectively.

Beginner3 min readUpdated 2026-07-27Notes by Callum Bennett

Start here

  • Check that your title tag, canonical tag, and H1 are present and correct on every important page.
  • Make sure robots.txt doesn't block pages you want indexed, and that noindex directives are on crawlable pages.
  • Validate structured data with Google's Rich Results Test before publishing.
  • Use Google Search Console's URL Inspection tool to see exactly how Google sees your page.

Here's the short version of what you need to look for.

What I'd do first

  • Open any page in your browser and view the page source (Ctrl+U or Cmd+U).
  • Check that the <title> tag is unique and describes the page content.
  • Look for a <link rel="canonical"> tag pointing to the correct URL.
  • Confirm there's a single <h1> that matches the page's main topic.
  • Search for noindex in the source — if you see it, make sure you meant to hide the page.
  • If you use structured data, paste the JSON-LD block into Google's Rich Results Test to validate it.

Plain-English take

Think of SEO code as the instruction manual for search engine bots. The HTML tells them what the page says (headings, paragraphs, links). The CSS and JavaScript tell them how it looks and behaves — but if those files are blocked, the bot might see a blank page. Structured data (like JSON-LD) is a cheat sheet that helps Google understand whether your page is a recipe, a product, an event, or something else. If any of these pieces are missing or broken, the bot might skip your page or misunderstand it.

When it actually matters

  • New site launch: You want every page to be crawlable and indexable from day one.
  • After a redesign or CMS migration: Templates often change, and canonical tags or robots directives can get lost.
  • When pages aren't showing up in search: The first thing I check is whether the page is blocked by robots.txt or has a stray noindex tag.
  • Before adding structured data: If the code doesn't match the visible content, Google may ignore it or issue a manual action.

What I got wrong

  • I once blocked a whole section of a site in robots.txt, thinking it would save crawl budget — but I also put noindex on those pages. Google couldn't see the noindex directive because it couldn't crawl the page. The pages stayed indexed for weeks.
  • I've seen people add canonical tags pointing to a URL that redirects to another URL. The canonical should always point to the final, 200-status URL.
  • Structured data is another trap: I've reviewed sites where the JSON-LD described a product, but the visible page was a blog post. Google's guidelines say the structured data must match the visible content.

Next step

Quick answers

What is SEO code?

SEO code refers to the HTML, CSS, JavaScript, and structured data in a page's source code that helps search engines crawl, understand, and index content.

Why is SEO code important?

Clean SEO code ensures search engines can discover, render, and index pages correctly, which directly affects visibility and rankings.

What are the most important SEO code elements?

Key elements include the title tag, canonical tag, robots directives, H1 heading, internal links, and structured data (JSON-LD).

How does SEO code differ from content SEO?

SEO code focuses on technical implementation (crawlability, indexability, rendering), while content SEO focuses on the quality and relevance of the text itself.

Sources

Primary documentation is linked directly. Anything commercial is marked nofollow.

Notes from Callum Bennett.