Generate a Sitemap with <loc> and <lastmod>
sugrokker last edited by sugrokker
Site Map Generator is an open source program used to create a customized site map with two attributes:
<url> <loc> https://docs.searchunify.com/Content/Content-Sources/Jive.htm </loc> <lastmod>2020-05-07</lastmod> </url>
It offers several options as well. The most useful is probably
-bwhich is used to specify the file types that shouldn’t be part of the sitemap.
- Server (or PC) with Python 3 or higher installed
- Server (or PC) with PIP3 installed
- Go to this page and copy the code.
- Create a file named
~$ touch sitemap_gen.py
- Paste the code into
- Generate a sitemap.
~$ python3 sitemap_gen.py https://yourwebsite.com/
- Depending on the size of the website, the command might continue to run for a few minutes. Once it has run its course, a file named
sitemap.xmlwill be created.
To exclude certain file types from the sitemap, use the argument
~$ python3 sitemap_gen.py -b png -b jpeg https://yourwebsite.com/
The above command puts all the images into the sitemap except for png and jpeg images.