Well... as @jordanjay29 suggested here i go to share a little script to build a basic proper sitemap. Have this running as a simple script is nice, but will be great have this running as extension.
The script is here: https://github.com/Zeokat/flarum-xml-sitemaps-script
The code build a sitemap index where the rest of sitemaps (users, tags, discussions) are stored. As example you can check this:
In this way, webmaster have more control over the parts of the forum they want to index or not. For example, i can decide to not index tags and i can remove the tag's sitemap from the sitemap index.
Search engines also have some limits when they process sitemaps, for example Google only accepts sitemaps with a maximun number of 50000 urls or max size of 10MB uncompressed. You can read the comments into the script to discover opportunities to optimize the sitemap.
I also recommend take a view at this post that comes directly from Google to webmasters: https://webmasters.googleblog.com/2014/10/best-practices-for-xml-sitemaps-rssatom.html
Another thing to have present are resources. For example, generate sitemap when a new discussion is created can be a problem into very active and big communities. Have options to generate sitemap each X mins or generate when new discussion is posted will be nice.
Another points missing on my script are the options
priority which are hadcoded. Will be nice an option to setup them manually according to the webmaster preferences.
I summarize the desired features:
- Possibility of split sitemaps larger than 50000 URLs or 10MB (uncomporessed).
- Possibility to chose which community parts include on sitemap (users, tags, discussions, etc).
- Possibility to include/exclude specific discussions based on tags associated.
- Possibility to setup
priority for each part of the forum (users, tags, discussions, etc).
- Possibility to setup when generate the sitemap (on new discusssion, each X min, daily, etc...).
If one skilled coder can build the extension i will be very happy to help testing because i don't know how to code advanced Flarum extensions properly.