Skip to content
PageAudit

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.

Updated

1Export the Head

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

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/" />
  </>
);

2Generate 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.

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

3Audit 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.

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