Hello,
I apologize for the inconvenience you are facing with your sitemap order. To reverse the order of your sitemaps so that the last sitemap (sitemap29) shows the most recent items, you can follow these steps:
-
Check Sitemap Generation Settings: Ensure that your sitemap generation settings are correctly configured to display the most recent items first. You can usually find this setting in your SEO plugin’s settings or within your website’s backend.
-
Customize Sitemap Order: If your SEO plugin, like Rank Math, doesn’t have a built-in option to change the order of the sitemap, you may need to customize the sitemap generation code. This customization might involve modifying the plugin’s code or adding custom filters to reorder the sitemap entries.
-
Seek Professional Assistance: If you are not comfortable making these changes yourself, I recommend reaching out to a developer or your SEO plugin’s support team for further assistance. They can provide guidance on how to customize the sitemap order effectively.
If you need further assistance or clarification on any of these steps, please feel free to reply here.
Thank you for bringing this issue to our attention.
Sources:
Rank Math Sitemap Issues and Their Fixes » Rank Math
Why the Sitemap_Index.xml is Throwing a 404 Error » Rank Math
Hello,
Rank Math sitemap shows the most recent links first and the oldest last. This is the best practice and every other SEO plugin displays this way. If you want a different sort order, you can use the HTML sitemap instead, here’s a filter to change the HTML sitemap sort order:
/**
* Filter: 'rank_math/sitemap/html_sitemap/sort_items' - Allow changing the sort order of the HTML sitemap.
*
* @var array $sort {
* @type string $field The field to sort by.
* @type string $order The sort order.
* }
* @var string $type The item type.
* @var string $name The post type/taxonomy name.
*/
add_filter('rank_math/sitemap/html_sitemap/sort_items', function ($sort, $type, $name) {
return $sort;
}, 10, 3);
You could also decide to create a custom sitemap and then include that sitemap in the Rank Math sitemap index. Here’s a filter to add an external sitemap to the Rank Math sitemap:
add_filter( 'rank_math/sitemap/index', function( $xml ) {
$xml .= '
<sitemap>
<loc>http://example.com/new-sitemap.xml</loc>
<lastmod>2020-09-14T20:34:15+00:00</lastmod>
</sitemap>';
return $xml;
}, 11 );
We hope this helps you resolve the issue. Don’t hesitate to contact us again with any other questions or concerns regarding Rank Math. We are always happy to help.
Thank you for choosing Rank Math!
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.