January 25, 2023
/ 76 /How to add sitemap to your site using netlify plugin
You are done building your website, but you need an automatic way of generating sitemap for your website without having to do much work.
Here is a simple guide on how to do just that.
Note.
Your website has to be built with plain old HTML or any SSG (Static Site Generator) such as Hugo, Gatsby, 11ty etc. and also must be uploaded to Netlify.
- You need to go to your Netlify dashboard
- Click on the Integrations tab
- On the integration dashboard, click on the search bar and type “sitemap”
- Then, click on enable
- The sitemap plugin prompt “install” will appear
- After clicking the “Install” button, you will be redirected to the dashboard.
Voilà, you are done! But one last thing to do is for you to clear the cache of your site and redeploy.
- You can do this by clicking on the production deploys tab then, you will see a page as below
- Click on the trigger deploy dropdown and then click on clear cache. Wait for Netlify to do it’s work and then visit your site URL and apply /sitemap.xml e.g. yoursite.com/sitemap.xml
UPDATE