Static Sitemap

  • Static sitemaps are Suitable for small websites with relatively static content. You manually list all URLs in an XML file.

Steps to create Static sitemap

  • Create a file named sitemap.xml in the app directory.
  • Use XML syntax to list your website URLs.
  • Update the loc attribute with each page’s URL and the lastmod attribute (optional) with the last modification date (ISO 8601 format).
  • Manually maintain this file as your website grows.

Example: This example shows the static sitemap.

XML
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns=
"http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://your-website.com/</loc>
    <lastmod>2024-06-09T00:00:00Z</lastmod>
  </url>
  </urlset>

How to Create a Sitemap in Next.js 13?

The Sitemap is an XML file that notifies search engines like Google about the structure and content of the website. This would helps search engines to discover and index the pages efficiently which improve the website SEO (Search Engine Optimization).

Similar Reads

Prerequisites

Node JSReact JSNext JS...

Steps to Create Next JS Application

Step 1: Create a NextJS application using the following command...

Static Sitemap

Static sitemaps are Suitable for small websites with relatively static content. You manually list all URLs in an XML file....

Dynamic Sitemap (Recommended)

Dynamic sitemaps are ideal for larger websites with dynamic content. You write code to generate the sitemap automatically based on your application data....

The benefits of using Sitemap

Improved Indexing:  A sitemap acts like a roadmap for search engines like Google,  letting them know about all the pages on your website.SEO Efficiency:  Sitemaps provide search engines with valuable information beyond just URLs. You can specify priority levels for different pages and update frequencies, giving search engines a better understanding of the importance of various sections of your site.Faster Discovery of New Content: With a dynamic sitemap, whenever you add new pages to your Next.js website, the sitemap automatically updates to reflect the changes....

Conclusion

For websites with relatively static content (few changes), a static sitemap is a simple, manual solution. You create an XML file with the URLs of your main pages and update it whenever necessary and for larger websites with dynamic content or frequent updates, a dynamic sitemap (using next-sitemap) is more efficient. This will automatically generates the sitemap for the website, ensuring it’s always up-to-date with your content....

Contact Us