How to Generate Google XML Sitemap for – Magento 2

Log in to your Magento 2 shop, Click Marketing, then click Site Map which is under SEO & Search.

Next Click Add SiteMap, Filling in your sitemap name, say sitemap.xml, and filling in the Path, how if we fill in “/” and generate the new sitemap, sometimes we will get a 404 error page, so we can fill in “/pub/”, and generate the new sitemap will be generated successfully.

I have tried this method for https://www.optical4u.com/, its sitemap is https://www.optical4u.com/sitemap.xml