Create xml sitemaps from the command line.
$ npm install -g sitemap-generator-cli
$ sitemap-generator [options] <url>
The crawler will fetch all sites matching folder URLs and file types parsed by Google. If present the robots.txt
will be taken into account and possible rules are applied for any URL to consider if it should be added to the sitemap.
Tip: Omit the URL protocol, the crawler will detect the right one.
Important: Executing the sitemap-generator with sites using HTML base
-tag will not work in most cases as it is not parsed by the crawler.
$ sitemap-generator --help
Usage: sitemap-generator [options] <url>
Options:
-h, --help output usage information
-V, --version output the version number
-q, --query consider query string
-f, --filename [filename] sets output filename
-p, --path [path] specifies output path
-s, --silent omit crawler notifications
Default: false
Consider URLs with query strings like http://www.example.com/?foo=bar
as indiviual sites and add them to the sitemap.
$ sitemap-generator -q example.com
Default: sitemap
Specify an alternate filename for the XML output file. The .xml
file extension is optional, it will be added automatically.
$ sitemap-generator --filename="sitemap-foo" example.com
Default: .
Specify an alternate output path for the generated sitemap. Default is the current working directory.
$ sitemap-generator --path="../foo/bar" example.com
Default: false
Omit the crawler notifications of found or not found sites.
$ sitemap-generator -s example.com