XML Sitemap to podstawowe narzędzie komunikacji z wyszukiwarkami. Dla dużych stron (>10,000 URL) wymaga strategicznego podejścia.
Czym jest XML Sitemap
XML Sitemap to plik informujący wyszukiwarki o stronach dostępnych do indeksacji. Format:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page</loc>
<lastmod>2024-12-01</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Limity techniczne
| Parametr | Limit |
|---|---|
| URL w jednym sitemap | 50,000 |
| Rozmiar pliku | 50 MB (uncompressed) |
| Sitemaps w index | 500 (Google) |
| Maksymalna głębokość | 1 (index → sitemap) |
Co MUSI być w sitemap
- Strony kanoniczne (canonical = self)
- Strony z status 200
- Strony indexable (bez noindex)
- Strony z wartościowym contentem
Co NIE powinno być w sitemap
"Sitemap z 404, redirects i noindex pages to sygnał niskiej jakości dla Google." - Google Search Central
- Strony z noindex
- Redirecty (301, 302)
- Błędy 4xx i 5xx
- Parametry URL (?sort=, ?filter=)
- Paginacja (zazwyczaj)
- Search results pages
- Duplicate content
Sitemap Index dla dużych stron
Struktura sitemap index:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2024-12-01</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-categories.xml</loc>
</sitemap>
</sitemapindex>
Segmentacja sitemaps
Rekomendowana struktura:
-
sitemap-products.xml- produkty -
sitemap-categories.xml- kategorie -
sitemap-blog.xml- artykuły -
sitemap-pages.xml- statyczne strony -
sitemap-images.xml- (opcjonalnie)
lastmod - używaj poprawnie
Kiedy aktualizować lastmod
- Istotna zmiana contentu
- Dodanie nowych zdjęć
- Zmiana ceny (e-commerce)
- Update structured data
Kiedy NIE aktualizować
- Drobne poprawki CSS/JS
- Zmiana linków w footerze
- Automatyczne timestamp updates
priority i changefreq
Google oficjalnie ignoruje te atrybuty, ale:
| Typ strony | Priority | Changefreq |
|---|---|---|
| Homepage | 1.0 | daily |
| Kategorie | 0.8 | weekly |
| Produkty | 0.6 | weekly |
| Blog posts | 0.6 | monthly |
| Statyczne strony | 0.4 | monthly |
Image i Video Sitemaps
Image sitemap
<url>
<loc>https://example.com/product</loc>
<image:image>
<image:loc>https://example.com/image.jpg</image:loc>
<image:title>Product Name</image:title>
</image:image>
</url>
Monitoring sitemap
Google Search Console
Sitemaps report pokazuje:
- Submitted vs Indexed URLs
- Last read date
- Discovered URLs
- Errors
Czerwone flagi
- Duża różnica submitted vs indexed
- Sitemap nie crawlowany >7 dni
- Errors w sitemap report
Automatyzacja sitemaps
Dla dynamicznych stron:
- Generate sitemap z DB query
- Filter out noindex, 404, redirects
- Compress (gzip)
- Auto-submit przy zmianach (ping)
Podsumowanie
XML Sitemap to must-have dla SEO. Dla dużych stron kluczowa jest segmentacja, czystość (tylko indexable) i poprawne lastmod.