Why I removed empty categories from the sitemap (and fixed soft 404s)
Short answer: SitemapController now emits only categories that have ≥1 published post, because empty archive pages looked like soft 404s to Google and bloated the sitemap after I merged duplicate cybersecurity categories.
Before
- 10 categories in sitemap
- 2 had zero live posts after cleanup
- Crawlers hit thin archives repeatedly
After
BlogCategory::query()
->whereHas('posts', fn ($q) => $q->published())
->get();
Plus tests in tests/Feature/Cms/SeoEndpointsTest.php.
GSC interaction
When removing URLs, use Removals for legacy shop paths—not sitemap categories you intend to fill later. See internal AdSense prep notes on /product/ prefixes.
Pair with crawlable category HTML
Category pages render post lists in static fallback—empty categories showed “No posts” with 200 OK but no value (crawlable HTML).
FAQ
noindex empty categories instead?
Valid alternative—I prefer omitting from sitemap + 404 if slug retired.
hreflang?
Not needed—single locale site.
Impact on AdSense?
Indirect—cleaner crawl profile supports “substantial site” narrative.
Maintenance note (Sep 2026)
Re-validated internal links and examples against the live aviwebsquad.in CMS after the Hostinger migration; guidance in this article still matches production.