Menu

Post image 1
Post image 2
1 / 2
0

Generating Sitemaps is Easy

DEV Community·Benyamin Khalife·19 days ago
#QCg2abEC
#php#seo#webdev#opensource#sitemap#fullscreen
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. PHP 8.1+ and the xmlwriter extension (which is almost always enabled by default).…

Continue reading — create a free account

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

Read More