# Audit a Gatsby site's SEO with PageAudit

Put the title, description and canonical link in each page's Head API, generate the sitemap with the official plugin and audit.

PageAudit · Updated 2026-10-16

## Step 1. Export the Head

In each page, export Head with its title, description and canonical link.

```jsx
export const Head = () => (
  <>
    <title>Example home</title>
    <meta name="description" content="What this page offers, in one sentence." />
    <link rel="canonical" href="https://example.com/" />
  </>
);
```

## Step 2. Generate the sitemap

Install gatsby-plugin-sitemap and set siteUrl in gatsby-config.js. The plugin writes /sitemap-index.xml; robots.txt goes in the static folder.

```js
module.exports = {
  siteMetadata: { siteUrl: "https://example.com" },
  plugins: ["gatsby-plugin-sitemap"],
};
```

## 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 Gatsby site's SEO with PageAudit](https://pageaudit.online/guides/gatsby)
