Skip to content
gilltrish.dev

After launch: getting found and measuring it · Part 1

SEO, explained like you’re five (and what the heck is Open Graph?)

Beginner7 min read

The 30-second version

Google sends robots to read your pages, files them in a giant index, then picks which ones to show for each search. You can’t make Google rank you, but you can make your pages easy to find (a sitemap), say which copy is the real one (canonical URLs), describe them well (titles and descriptions), and be genuinely useful. Open Graph tags are a separate thing: they decide what your link looks like when someone shares it.

On this page

For a long time, SEO felt like magic to me. You type a few words into Google, and the exact page you needed shows up, like it read your mind. Abracadabra.

It isn’t magic, though (unfortunately). It’s a robot reading your site and a few simple signals that you control. This post walks through the ones that matter, with the actual code from this blog.

How Google works

Explain it like I’m five

Google is a giant library. Robots walk around the internet reading pages (crawling), the librarian files each page on a shelf (indexing), and when someone asks a question, the librarian picks which pages to hand them first (ranking).

How a page ends up in search results

  1. CrawlA robot visits your page
  2. IndexGoogle files it away
  3. RankGoogle picks what to show

Nothing you add to a page makes Google rank it. What you can do is remove obstacles and describe things clearly, so the robot understands what each page is about.

A google result of the post 'Small moves, big feelings: microanimations that everyone can enjoy' that includes the title and description

The basics, one tag at a time

Title and meta description

The <title> is the blue link in search results. The meta description is often the grey text under it. Here’s how this site sets both, in its base layout:

BaseLayout.astro· Astro
<title>{fullTitle}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonical} />
{noIndex && <meta name="robots" content="noindex" />}

Every post’s description comes from its excerpt in Sanity, unless I write a separate one in the post’s SEO tab.

Descriptions are for people, not robots

The meta description isn’t a ranking factor, and Google sometimes rewrites it. It still matters, because it’s your pitch: a clear description gets more clicks.

Headings and alt text

  • One h1 per page (the title), then h2s and h3s in order, like an outline. It helps search engines and screen readers for the same reason: the structure is clear.
  • Alt text describes images. It’s how images show up in image search, and how screen reader users know what’s in them.

What’s a sitemap?

Explain it like I’m five

A sitemap is a table of contents you hand the robot: “here are all my pages, and when each one last changed.” It’s a hint, not an order. Google still decides what to index.

This site builds its sitemap from Sanity on every build. Each post gets a lastmod date from when it was last updated, and posts marked “Hide from search engines” are left out:

sitemap.xml.ts· TypeScript
const indexable = posts.filter((post) => !post.seo?.noIndex)
const postDate = (post) => post.updatedAt ?? post.publishedAt

const entries = [
  {path: urls.home(), lastmod: latest},
  ...indexable.map((post) => ({path: urls.post(post.slug), lastmod: postDate(post)})),
  // …series, tags and projects
]
The sitemap of my site, including pages and posts with last modified times/dates

On WordPress, you already have one: WordPress has built a sitemap at /wp-sitemap.xml since version 5.5. SEO plugins like Yoast replace it with their own (Yoast’s is at /sitemap_index.xml).

What’s robots.txt?

Explain it like I’m five

robots.txt is the sign on the front door: “robots, you can go here, but not there.” Polite robots follow it. It’s a request, not a lock.

This site’s robots.txt lets everyone in and points them at the sitemap:

robots.txt· Text
User-agent: *
Allow: /

Sitemap: https://gilltrish.dev/sitemap.xml

Blocking a page isn’t the same as hiding it

If robots.txt blocks a page, Google can’t read it, but it can still list the address if other sites link to it. To keep a page out of search results, add a noindex tag and don’t block it, so Google can read the tag. This site’s “Hide from search engines” toggle adds that tag.

WordPress’s “Discourage search engines” box

Under Settings → Reading, WordPress has a “Discourage search engines from indexing this site” checkbox. I always tick it on staging sites, so the test copy doesn’t end up in Google. The catch is remembering to untick it on the live site at launch, so put it on your launch checklist. It’s also only a polite request: for a staging site, a password is the real protection.

What does canonical mean?

The same page can live at several addresses: with and without www, with a trailing slash, with tracking codes like ?utm_source=newsletter on the end. To you, that’s one page. To a robot, it might be five copies.

Explain it like I’m five

A canonical URL is the page saying “I’m the original. If you find copies of me, give the credit to this address.”

On this site, the canonical URL is built from the site’s address plus the page path (the <link rel="canonical"> line in the code above). The site also never uses trailing slashes, and Cloudflare redirects www to the plain domain, so there’s only one version of each page anyway.

That’s also why the site’s address setting mattered so much when I moved from the temporary workers.dev address to gilltrish.dev: every canonical URL, sitemap entry and share link is built from it. I wrote about that in How I built this blog, Part 2.

What’s Open Graph?

Explain it like I’m five

When you paste a link into LinkedIn, Slack or a text message, the app asks the website, “what’s your poster?” Open Graph tags are the poster: a title, a short description and an image.

Facebook created Open Graph, and now nearly everyone reads it. X has its own twitter: tags, but falls back to Open Graph for most of them. These are this site’s tags:

BaseLayout.astro· Astro
<meta property="og:title" content={title ?? SITE.name} />
<meta property="og:description" content={description} />
<meta property="og:url" content={canonical} />
<meta property="og:type" content={article ? 'article' : 'website'} />
<meta property="og:image" content={image} />
<meta property="og:image:alt" content={imageAlt} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />

The share image comes from the post’s SEO tab if I set one there, otherwise from the post’s main image, otherwise from a default image for the whole site.

The share image has to be reachable

Use the full address (starting with https://), make sure it’s public, and keep the file small. 1200×630 pixels is the usual size. Facebook’s limit is 8 MB, and LinkedIn’s is often quoted as 5 MB, but under 1 MB is better for everyone.

You can check what a link will look like before you share it:

Social share preview of a blog post from gilltrish.dev: Small moves, big feelings: microanimations that everyone can enjoy
LinkedIn Post Inspector displays a preview of a shared article on gilltrish.dev: Small moves, big feelings: microanimations that everyone can enjoy

Previews get cached

Fixed your image and the old one still shows up? The platform remembers the first version it saw. Paste the link into LinkedIn Post Inspector to make it fetch the page again.

Structured data, briefly

Structured data is a small block of JSON in the page that tells Google, in its own vocabulary, “this is a blog post, written by this person, published on this date.” This site adds it to every post:

[slug].astro· TypeScript
const jsonLd = {
  '@type': 'BlogPosting',
  headline: post.title,
  description,
  datePublished: post.publishedAt,
  dateModified: post.updatedAt ?? post.publishedAt,
  author: {'@type': 'Person', name: author.name},
}

Google’s Rich Results Test checks whether it can read it.

Google Search Console

Search Console is Google’s free dashboard for your site in search. It’s where you find out what Google actually thinks of your pages.

Step 1:Verify that the site is yours

Add your domain in Search Console and follow the steps to prove you own it. Usually that’s a TXT record in your DNS settings. For some DNS providers, including Cloudflare, Search Console offers to add the record for you.

Step 2:Submit your sitemap

Under Sitemaps, enter the address of your sitemap (for example sitemap.xml) and submit it.

My Sitemap that was submitted on October 30th. Status is listed as "Success".

Step 3:Check the Pages report

Indexing → Pages shows which pages are in Google and which aren’t, with a reason for each. “Crawled – currently not indexed” sounds scary, but it often just means Google read the page and didn’t think it needed it yet. It’s common on new sites.

Step 4:Inspect a single page

Paste any address into URL Inspection at the top to see if it’s indexed, when Google last visited, and to ask it to look again after a change.

What actually matters most

What I’d tell past me

Write useful pages that answer real questions, make them fast, make them work on phones, and earn links from real people. Tricks come and go. Those four don’t.

What could go wrong

  • Your staging site shows up in Google.
  • The same page lives at several addresses with no canonical URL.
  • Pages with missing or identical titles.
  • A share image that’s moved or deleted, so every preview is blank.
  • noindex left on after launch.

What I’d tell past me

This actually matters. Hardly anyone goes to page 2 of the search results, so you want to be number one, or close to it.

Getting people to your site is half of it. Next in this series: finding out what they do once they’re there, with a dashboard I built for a travel client.