Roiarthur
Active member
Because my forum have24,00+ urls, the automatic update of my sitemap was not working, i has to recreate a new sitemap every weeks, tired of that situation i found a soultion that is working.
I reduce Sitemap File Size to Prevent Indexing Update Errors
I reduce Sitemap File Size to Prevent Indexing Update Errors
Introduction
When a XenForo sitemap exceeds 20,000 URLs, indexing issues can occur, especially in Google Search Console. This is often due to the sitemap files being too large. This tutorial explains how to adjust XenForo settings to generate smaller sitemaps and avoid these problems.
Prerequisites
• Advanced knowledge of Windows
• Proficiency with Windows system tools
• Administrator rights required
Procedure
• Step #1 : Identify the current URL limit per sitemap file
• Step #2 : Edit MAX_FILE_ENTRIES value in Builder.php
• Step #3 : Enable friendly URLs in XenForo
• Step #4 : Manually rebuild the sitemap
• Step #5 : Verify sitemap submission in Google Search Console
Difficulty Level
• Step #1 : Easy
• Step #2 : Medium
• Step #3 : Easy
• Step #4 : Easy
• Step #5 : Easy
Advantages
• Step #1 : Understand the current sitemap configuration
• Step #2 : Reduce sitemap file size for better indexing
• Step #3 : Improve sitemap accessibility for search engines
• Step #4 : Generate updated sitemaps with the new settings
• Step #5 : Ensure proper sitemap submission to Google
Disadvantages
• Step #1 : Requires access to XenForo system files
• Step #2 : Risk of errors when modifying source code
• Step #3 : May require web server reconfiguration
• Step #4 : Sitemap generation time depends on site size
• Step #5 : Delay before Google processes the new sitemap
Step #1 Identify the current URL limit per sitemap file
Access XenForo’s Builder.php file
Open this file:
Look for the MAX_FILE_ENTRIES constant to check the current limit
Note the value defined for this constant
Step #2 Edit the MAX_FILE_ENTRIES value in Builder.php
Open Builder.php in a code editor
Find the line containing:
Change the value to reduce the number of URLs per sitemap file, for example:
Save and close the file
Step #3 Enable friendly URLs in XenForo
Log into the XenForo admin panel
Navigate to: Options > SEO
Enable the "Use Friendly URLs" option
Save the changes
Step #4 Manually rebuild the sitemap
In the XenForo admin panel, go to: Tools > Rebuild Caches
Select "Rebuild Sitemap"
Run the rebuild process
Wait for the process to complete so the new sitemap files are generated
Step #5 Verify sitemap submission in Google Search Console
Go to Google Search Console
Select your site’s property
Open the "Sitemaps" section
Submit your new sitemap using the URL:
Ensure that Google accepts the sitemap without errors
Tip
For better indexing, consider reducing MAX_FILE_ENTRIES to 5000 or even 1000 depending on your site's size and server performance.
Warning
Editing XenForo core files can cause issues during future updates. Document all changes made and reapply them after updates if needed.
Advice
After adjusting sitemap settings, monitor Google Search Console regularly for indexing errors and adjust parameters as needed.
Conclusion
By adjusting XenForo to generate smaller sitemaps and enabling friendly URLs, you can improve search engine indexing of your site and prevent issues caused by oversized sitemap files.
I reduce Sitemap File Size to Prevent Indexing Update Errors
I reduce Sitemap File Size to Prevent Indexing Update Errors

When a XenForo sitemap exceeds 20,000 URLs, indexing issues can occur, especially in Google Search Console. This is often due to the sitemap files being too large. This tutorial explains how to adjust XenForo settings to generate smaller sitemaps and avoid these problems.

• Advanced knowledge of Windows
• Proficiency with Windows system tools
• Administrator rights required

• Step #1 : Identify the current URL limit per sitemap file
• Step #2 : Edit MAX_FILE_ENTRIES value in Builder.php
• Step #3 : Enable friendly URLs in XenForo
• Step #4 : Manually rebuild the sitemap
• Step #5 : Verify sitemap submission in Google Search Console

• Step #1 : Easy
• Step #2 : Medium
• Step #3 : Easy
• Step #4 : Easy
• Step #5 : Easy

• Step #1 : Understand the current sitemap configuration
• Step #2 : Reduce sitemap file size for better indexing
• Step #3 : Improve sitemap accessibility for search engines
• Step #4 : Generate updated sitemaps with the new settings
• Step #5 : Ensure proper sitemap submission to Google

• Step #1 : Requires access to XenForo system files
• Step #2 : Risk of errors when modifying source code
• Step #3 : May require web server reconfiguration
• Step #4 : Sitemap generation time depends on site size
• Step #5 : Delay before Google processes the new sitemap



Code:
src/XF/Sitemap/Builder.php





Code:
const MAX_FILE_ENTRIES = 50000;

Code:
const MAX_FILE_ENTRIES = 10000;
















Code:
https://yoursite.com/sitemap.xml


For better indexing, consider reducing MAX_FILE_ENTRIES to 5000 or even 1000 depending on your site's size and server performance.
Code:
const MAX_FILE_ENTRIES = 5000;

Editing XenForo core files can cause issues during future updates. Document all changes made and reapply them after updates if needed.
Code:
src/XF/Sitemap/Builder.php

After adjusting sitemap settings, monitor Google Search Console regularly for indexing errors and adjust parameters as needed.
Code:
https://search.google.com/search-console

By adjusting XenForo to generate smaller sitemaps and enabling friendly URLs, you can improve search engine indexing of your site and prevent issues caused by oversized sitemap files.