Generate your sitemap for Next.js in two quick steps
with our dynamic and automatic generator
A sitemap is the list of pages that your website contains, this document is necessary if you would like to enhance your search engine optimization (SEO) performance regarding search engines so that they can discover, index and then show impressions of your pages in the search engine results page (SERP).
Basically, it is an XML document validated with a document type definition(DTD), and it contains attributes describing pages.
The most important attributes are :
Frequency | Description |
---|---|
daily | Pages are changing daily |
hourly | Pages are changing each hour like news |
weekly | Pages are changing on a weekly basis |
monthly | Pages are changing at the pace of each month |
yearly | Pages are changing once a year |
never | Pages are static, no change is forecasted |
always | Pages are changing regularly |
The highest the value is, the more important the page is. You should not use a value of 1 in all pages as it is a relative value to compare between pages
The automatic sitemap generator let you build your sitemap easily with two quick steps for Next.js based project, it is easy to use and free of charge
Step 1 : All you have to do is provide your domain name which is the only required parameter so it can generate the sitemap for you, there is also other parameters that you can change if you wish to like frequency, priority.. .
It is also possible to exclude some pages from indexing like for example /admin, all you have to do is to type in the page name and click the plus sign, you can add as many as you want.
By default pages starting with underscore are excluded like _app.js and _document.js.
Step 2 : click next, and you will be routed to next page where you need to copy and paste a js script on your root directory and run it using node.js, what the script does is looking dynamically for your pages and generating a json object containing the pages that should be included in sitemap.
The resulting json will be printed on a separate file on your directory, open it and paste its content in the box provided for this purpose, and then click generate sitemap.
Finally you should be able to see your sitemap and all you have to do is copy it under public folder with the name provided by the tool, push your code and your good to go.
To have a better ranking in search results, one must think of sitemap, which helps search engine discover your domain pages more quickly and then early existence on page results.