Menu

1 / 2

Generating Sitemaps is Easy

DEV Community·Benyamin Khalife·6 months ago
#QCg2abEC
#php#seo#webdev#opensource#sitemap
Reading 0:00
15s threshold

I've been building PHP projects for a while, and one of those annoying little tasks that keeps coming up is generating sitemaps. Not because it's technically hard — it's just tedious. You either roll your own XML string builder (and inevitably forget an edge case), or you pull in a heavy package that does ten things you don't need.

So I wrote a small library called webrium/sitemap to handle it cleanly. No bloat, just a focused tool that covers the real-world cases: images, videos, hreflang for multilingual sites, gzip, and automatic splitting for large sites.

Getting Started

composer require webrium/sitemap

Enter fullscreen mode

Exit fullscreen mode

That's it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.