Fix Your Sitemap for Joomla
Optimize your Joomla sitemap: choose between OSMap, JSitemap, and XMap, configure menu coverage, handle multi-language hreflang, and stop unpublished articles from leaking into search.
Joomla sites have unique sitemap challenges because Joomla core does not generate a sitemap - every site relies on an extension, and each extension behaves differently. This guide covers the most common Joomla sitemap issues and exactly how to fix them.
Common Joomla Sitemap Issues
- Extension differences: OSMap, JSitemap, and XMap output slightly different XML and pick URLs differently
- Category and menu items over-represented - the sitemap lists every menu item including duplicates
- Component-generated URLs (com_content, com_k2, com_virtuemart) producing duplicate entries
- Multi-language sites missing hreflang annotations or splitting languages across separate sitemaps without an index
- Unpublished or archived articles leaking into the sitemap when state filters are misconfigured
- SEF (Search Engine Friendly) URLs disabled - sitemap contains ugly index.php?option=com_content URLs
- Priority and changefreq defaults not adjusted per content type
Understanding OSMap, JSitemap, and XMap
OSMap (by Joomlashack) is the most popular free option. It is a fork of XMap that is actively maintained for Joomla 4 and 5. Pro version adds priority settings and news/image/video sitemaps.
JSitemap Pro (by joomlatools) is a paid commercial extension with Google News, video, image, and geo sitemaps built in, plus real-time content analysis.
XMap is the original but has not been updated in years and is not Joomla 4 compatible. Legacy sites only.
Step-by-Step Fix Guide
- Install OSMap (or JSitemap Pro) via System > Install > Extensions and enable the system plugin
- Go to Components > OSMap and create a new sitemap - select only the menu items you want indexed, typically Main Menu and any language-specific menus
- Uncheck irrelevant menu items: login forms, search, tag pages with no content, and legacy menus
- Enable SEF URLs in System > Global Configuration > SEO so the sitemap contains clean URLs instead of index.php?option=com_content&view=article&id=42
- For multi-language sites, enable the language plugin and configure OSMap to include hreflang alternate links - each language gets its own URL entry with alternates
- Configure state filter to include only Published articles - exclude Unpublished, Archived, and Trashed
- Exclude unwanted components like com_users login pages, com_search results, and com_tags dynamic pages from the sitemap configuration
- Set sensible priority per content type (or skip - Google ignores priority) and configure changefreq based on actual update cadence
- Create a menu item of type "OSMap - XML Sitemap" aliased to
sitemap.xmlso your sitemap is accessible at yoursite.com/sitemap.xml - Add a Sitemap line to robots.txt:
Sitemap: https://yoursite.com/sitemap.xml - Submit the sitemap URL in Google Search Console under Indexing > Sitemaps and monitor coverage
Example Joomla sitemap URL structure
# With OSMap and a SEF menu alias https://yoursite.com/sitemap.xml # Multi-language (language-prefixed) https://yoursite.com/en/sitemap.xml https://yoursite.com/fr/sitemap.xml # Sitemap index referencing each language https://yoursite.com/sitemap_index.xml
Multi-language hreflang in Joomla sitemaps
Joomla's multi-language feature associates each article with a language, and OSMap/JSitemap can emit xhtml:link alternate entries inside each URL. Enable the "Include hreflang" option in OSMap Pro or JSitemap Pro. Verify in GSC's International Targeting report that alternate URLs are detected without errors. If your alternates are missing, check that each article has a content association set up under Content > Articles > Associations.
What I see when I audit Joomla sitemaps
Most Joomla sitemaps I audit fall into one of two categories: the sitemap mirrors the menu structure (so it has your About, Contact, Services menu items and maybe a dozen top articles, missing the 600 actual content pieces), or it went the other way and includes every com_content, com_k2, com_virtuemart, and com_users URL including admin panels and user profiles.
One Joomla 4 site I looked at last month had 8,400 URLs in its sitemap. Turned out 6,200 of them were /component/users/ profile URLs for registered commenters. Every commenter created a public profile URL, all indexed, all indexed as thin content. They'd lost 40% of their organic traffic over 9 months and didn't understand why.
Fix was to exclude com_users from OSMap's sitemap config, noindex the user profile view globally, and resubmit. Traffic recovered in 7 weeks. The lesson: Joomla's extensibility is great, but every component silently adds URLs to your sitemap unless you explicitly exclude them.
OSMap-specific fix steps
If you're on OSMap (free or Pro), here's my usual sequence for cleaning up a broken Joomla sitemap:
- Go to Components > OSMap > Sitemaps. Most sites have a default "Default Sitemap" you can edit.
- Under "Menus," select ONLY your public content menus. Uncheck "User Menu," "Admin Menu," and any backend or hidden menus.
- For each included menu item, click the item and check "Change frequency" and "Priority" - set blog to weekly/0.6, main pages to monthly/0.8. Google ignores these but Bing doesn't.
- Go to OSMap plugin settings (System > Manage > Plugins, search "OSMap") and disable plugins for components you don't want in the sitemap.
- In System > Global Configuration > SEO, enable "Search Engine Friendly URLs" and "Use URL rewriting." Without these, your sitemap is full of
?option=com_content&view=article&id=42junk. - Create an .htaccess-level redirect from
/sitemap.xmlto your OSMap URL so you get a clean public URL.
JSitemap-specific fix steps
JSitemap Pro is heavier on features and lighter on sensible defaults. The "automatic data source" scanner is aggressive - it'll pick up every component including ones you don't want indexed.
- Go to Components > JSitemap > Data Sources.
- Disable the "com_users," "com_search," "com_finder," "com_mailto," and "com_wrapper" data sources. These add admin and utility URLs.
- For your content source (com_content, com_k2, or whatever CMS you use), click Edit and set "Published state" to Published only. Default is often "all states" which leaks unpublished drafts.
- Enable "Exclude by URL pattern" and add patterns like
/component/,/administrator/,/tag/if tag pages are thin. - JSitemap Pro ships with
/index.php/sitemap.xmlby default. Create an alias menu item at/sitemap.xmlto get a clean URL. - Under "Settings > Image sitemap" and "Video sitemap" - enable these if you actually have images/videos worth indexing, otherwise leave them off. JSitemap will otherwise list every decorative site image.
Joomla-specific mistakes I keep seeing
- Duplicate URLs from the same article reachable through multiple menu items. Joomla uses menu aliasing - one article can live at
/about/teamand/company/team. Sitemap lists both. Canonical one to the other or pick a primary menu and hide the alternate. - Default com_content pagination.
?start=5,?start=10,?start=15. The sitemap includes every pagination URL. Set "Ignore URL parameters" in OSMap/JSitemap. - com_search results URLs indexed. I've seen sitemaps with 3,000+ search result URLs. Always exclude com_search.
- K2 category page duplication. K2 creates both
/itemlist/category/5-newsand/newsmenu item URLs for the same content. Pick one via canonical, sitemap only the menu version. - Multi-language splitting without hreflang. English and French versions both get submitted as separate URLs with no alternate annotations. Content Associations under Content > Articles > Associations is the missing link.
- Cache plugin caching the sitemap. JCH Optimize and System Cache can cache the sitemap XML for days. Exclude the sitemap URL from the cache or your lastmod tags lie.
Quick diagnosis commands
# Count URLs in your Joomla sitemap curl -s https://yoursite.com/sitemap.xml | grep -c '<loc>' # Hunt for component leakage curl -s https://yoursite.com/sitemap.xml | \ grep -oE '<loc>[^<]+</loc>' | \ grep -iE 'component/|option=com_|administrator|index.php\?' # Check for unpublished articles sneaking in # (any URL returning 404 when you GET it)
If the second command returns results, your SEF URLs aren't fully applied or your sitemap extension is bypassing them. Fix the SEF config first, then regenerate.