Troubleshooting Sitemap Issues in Magento 2
Common issues and solutions for the Google Sitemap & Robots extension. Start with quick diagnostics, then find your specific issue below.
Quick Diagnostics
- Check sitemap module enabled: Magmodules → Sitemap → General → Enabled
- Check feed generation enabled: Feed Generation Settings → Enable (per store view)
- Verify cron running: Check
cron_scheduletable or run generation manually via CLI - Check logs:
var/log/for debug information
Sitemap Issues
Problem: Sitemap is empty or has no URLs
Symptoms:
- Sitemap generates but contains 0 URLs
- XML file is very small
Solutions:
-
Check module is enabled:
- Magmodules → Sitemap → General → Enabled must be Yes
-
Check feed generation enabled:
- Feed Generation Settings → Enable must be Yes for the store view
-
Check noindex exclusion:
- If "Exclude No-Index" is enabled, verify pages aren't all marked noindex
-
Verify products/categories exist:
- Ensure you have enabled products and active categories
Prevention: Start with basic configuration, then add exclusions as needed.
Problem: Sitemap generation fails or times out
Symptoms:
- Sitemap generation never completes
- PHP timeout errors in logs
- Memory exhausted errors
Solutions:
-
Run via CLI instead of admin:
bin/magento mm-sitemap:generate --store-id=1CLI has longer timeouts and no browser limitations.
-
Reduce sitemap size:
- Lower "Maximum No of URLs Per File" setting
- The module will create multiple files automatically
-
Increase PHP limits (temporary):
- Increase
max_execution_timeandmemory_limitfor CLI
- Increase
Problem: Sitemap URL returns 404
Symptoms:
- Clicking sitemap URL shows page not found
- Sitemap file doesn't exist
Solutions:
-
Check sitemap was generated:
- Look for the file in your Magento root or configured location
- Check generation timestamp in admin
-
Regenerate sitemap:
- Click Generate button or run CLI command
-
Check file permissions:
- Ensure web server can write to the sitemap location
-
Verify filename configuration:
- Check the configured filename in Feed Generation Settings
Problem: Missing pages in sitemap
Symptoms:
- Specific categories/products don't appear
- URL count is lower than expected
Solutions:
-
Check page status:
- Products/categories must be Enabled
- CMS pages must be Active
-
Check noindex settings:
- If "Exclude No-Index" is enabled, check page meta tags
-
Check visibility (products):
- Products set to "Not Visible Individually" may be excluded
-
Check store assignment:
- Pages must be assigned to the store view
Debug tip: Enable Debug Mode and check logs for exclusion reasons.
Problem: Sitemap file too large
Symptoms:
- File exceeds size limit
- Search engines reject sitemap
Solutions:
-
Configure file limits:
- Set "Maximum No of URLs Per File" to 50,000 or less
- Set "Maximum File Size" appropriately
-
Module handles this automatically:
- When limits are exceeded, a sitemap index is created
- Multiple sitemap files are generated
-
Verify sitemap index:
- Check if a sitemap index XML was created pointing to sub-files
Robots Issues
Problem: Robots settings not applying
Symptoms:
- Pages show wrong robots meta tag
- Default settings being ignored
Solutions:
-
Check robots module enabled:
- Magmodules → Robots → General → Enabled must be Yes
-
Clear cache:
- Full page cache may be serving old meta tags
bin/magento cache:flush -
Check page-level overrides:
- Individual pages may have robots set at the page level
- Page-level settings override defaults
-
Verify correct store view:
- Settings are per store view
Problem: Wrong robots on specific pages
Symptoms:
- Some pages have correct robots, others don't
- Inconsistent behavior
Solutions:
-
Check page-level settings:
- Categories: Catalog → Categories → [Category] → Search Engine Optimization
- Products: Catalog → Products → [Product] → Search Engine Optimization
- CMS Pages: Content → Pages → [Page] → Search Engine Optimization
-
Page settings take precedence:
- Module sets defaults, but page-level overrides win
-
Review the hierarchy:
- Page-level > Module defaults > Magento defaults
Cron Issues
Problem: Sitemap not auto-generating
Symptoms:
- Sitemap doesn't update automatically
- Manual generation works fine
Solutions:
-
Check cron is enabled:
- Feed Generation Settings → Cron Enable must be Yes
-
Verify Magento cron running:
bin/magento cron:run -
Check cron schedule table:
SELECT * FROM cron_schedule WHERE job_code LIKE '%sitemap%' ORDER BY scheduled_at DESC LIMIT 10; -
Check server cron:
- Ensure system cron is configured to run Magento cron
Debug Mode
Enable detailed logging:
- Go to Magmodules → Sitemap → Debug
- Set Debug Mode to Yes
- Save and regenerate sitemap
- Check
var/log/for detailed logs
Remember: Disable debug mode in production when troubleshooting is complete.
CLI Commands for Troubleshooting
# Generate sitemap manually (bypasses cron)
bin/magento mm-sitemap:generate --store-id=1
# Generate for all enabled store views
bin/magento mm-sitemap:generate
# Clear cache after configuration changes
bin/magento cache:flush
CLI output shows progress and any errors during generation.
Need More Help?
Documentation:
- All Help Articles - Complete documentation overview
Support:
- Contact Support - Get help from our team