Steps to Generate Static Sitemap in MERN Application
If the website you are working on has a fixed number of URLs, for example, your portfolio. You can generate a sitemap.xml file with the help of any online tool and place the folder in the src folder.
Step 1: Visit https://www.xml-sitemaps.com/ and generate the sitemap.xml file.
Step 2: Move the file into the public folder of your react app.
Project Structure:
Step 3: Verify the changes by visiting https://ahampriyanshu.com/sitemap.xml.
Step 4: Finally, Add the Sitemap to your robots.txt file
User-agent: *
Allow: /
Sitemap: https://baseurl/sitemap.xml
How to Generate Sitemap in a MERN Application ?
Generate Sitemap in a MERN Application refers to creating a file that lists the pages, videos, and other files on your website, as well as their relationships. Search engines (such as Google, Duckduckgo, Bing, and others) use this file to help them crawl your site more efficiently.