Skip to main content
Pricing Community Docs Get Started GitHub My Account
Community
Search
Log In
Log In Sign Up
Maxim

Maxim

Web Developer & Entrepreneur

I built UnGig after seeing talented immigrants trapped in gig work. Former driver, now helping others escape the 70-hour grind. 20+ years tech experience, bilingual (EN/RU), Your gig work skills ARE valuable - let me help you prove it.

Philadelphia, PA Joined Dec 28, 2023
Posts 1 Comments 1

⁨Maxim⁩'s Posts

Newest Top
Newest Top
Maxim Maxim Web Developer & Entrepreneur Nov 6, 2025

Adding XML Sitemap

Actions

I've created a simple installation script that adds a comprehensive XML sitemap to your Waterhole. This helps search engines discover and index all your content.

Features

  • Multiple sitemap endpoints organized by content type
  • API-style routing (/sitemap, /sitemap/posts, etc.)
  • Automatic content discovery for channels, posts, pages, and users
  • Proper XML formatting with timestamps, change frequency, and priority
  • Error handling - won't crash if a model is missing
  • robots.txt integration with sitemap reference

Installation

Download the attached install-sitemap.sh file, upload it to your Waterhole root directory, and run:

chmod +x install-sitemap.sh
./install-sitemap.sh

That's it! The script will automatically create all necessary files and routes.

Available Endpoints

After installation, you'll have these endpoints:

  • /sitemap - Complete sitemap with all content types
  • /sitemap/posts - Posts only (limited to 1000 most recent)
  • /sitemap/channels - Channels only
  • /sitemap/pages - Static pages only
  • /sitemap/users - User profiles (limited to 500)

SEO Setup

  1. Update your domain in public/robots.txt
  2. Test your sitemap: curl https://your-domain.com/sitemap
  3. Submit to Google Search Console
  4. Submit to Bing Webmaster Tools

Code Structure

The implementation creates:

  • app/Http/Controllers/SitemapController.php - Main controller with 5 methods
  • Routes in routes/web.php using prefix grouping
  • public/robots.txt with sitemap reference

Each URL includes:

  • <loc> - Full URL
  • <lastmod> - Last modification timestamp
  • <changefreq> - Update frequency hint
  • <priority> - Relative importance (0.0-1.0)

Why Multiple Endpoints?

For large forums, splitting the sitemap by content type:

  • Makes it easier to debug specific content issues
  • Allows selective reindexing in search consoles
  • Keeps individual sitemaps under the 50k URL limit
  • Improves crawl efficiency

Customization

You can adjust limits in the controller:

  • Posts: currently limit(1000)
  • Users: currently limit(500)
  • Channels and Pages: no limit (usually small)

Notes

  • No .xml extension needed - XML content type is set via headers
  • Clean URLs follow the same pattern as the Waterhole API
  • Error handling prevents crashes if models aren't available
  • Works with unlicensed Waterhole installations

Hope this helps improve your forum's SEO! 🚀

Attachment: install-sitemap.sh

❤️ 3 Love Loading...
2 ⁨2⁩ ⁨comments⁩
© 2025 Waterhole Pty Ltd
  • Product
    • Pricing
    • Releases
    • Roadmap
    • Demo
  • Resources
    • Documentation
    • Support
    • Experts
    • Blog
  • Community
    • Community
    • Twitter
    • GitHub
  • Company
    • Terms & Privacy
    • Software License