djmetzle.io

Gatsby SEO

27 March, 2020

I had noticed that this new website was not showing up in Google results. I should probably set up all of the Gatsby SEO features!

The simplest SEO feature in Gatsby is use of the react-helmet plugin to add metadata to page <head> tags. Using helmet, we can update <meta> and other tags on the fly from React.

The default starter includes a detailed SEO component ready to go. All that is needed is to include the SEO component on our pages. Do not forget to updates the site metadata in the gatsby-config.

If we want our sites to get indexed by search engines, then we probaby also want a sitemap. Crawlers use this list of endpoints as an index into the site. Gatsby has a plugin that generates sitemaps automatically. Install the plugin, configure it, and now our site has a sitemap. The same with robots.txt and that plugin!

Now there is slick SEO friendly metadata for the site.