# Audit a Hugo site's SEO with PageAudit

Write the title, description and canonical link in the theme head, turn on robots.txt and audit the published page.

PageAudit · Updated 2026-10-16

## Step 1. Write the head

In the base layout head, use the page title and description, with the site description as the fallback. Each page's description comes from the description field in its front matter.

```html
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ .Title }} | {{ site.Title }}{{ end }}</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ site.Params.description }}{{ end }}">
<link rel="canonical" href="{{ .Permalink }}">
```

## Step 2. Turn on robots.txt

In hugo.toml, enableRobotsTXT makes Hugo write /robots.txt. /sitemap.xml already comes out of every build, with the site baseURL.

```toml
baseURL = "https://example.com/"
enableRobotsTXT = true

[params]
  description = "What this page offers, in one sentence."
```

## Step 3. Audit the published page

Change the address to the published page. The answer brings the score, the counts and each error with its fix. No key: 10 free audits a day.

```sh
curl -sS -X POST https://pageaudit.online/api/audit \
  -H 'content-type: application/json' \
  -d '{"url": "https://example.com/"}'
```

[Audit a page](https://pageaudit.online/?url=https://example.com/)

[Audit a Hugo site's SEO with PageAudit](https://pageaudit.online/guides/hugo)
