Hello,
To create a custom sitemap for a new category of pages on your site, you can follow these steps:
-
Create a Custom Sitemap File:
- Navigate to WordPress Dashboard → Appearance → Theme File Editor (for Classic Theme) or WordPress Dashboard → Tools → Theme File Editor (for Block Theme).
- Create a new file in your child theme folder and name it, for example,
type-sitemap.php
.
- Add the necessary code to this file. You can refer to this guide for help with creating filters on your theme files.
-
Define the New Sitemap in Rank Math:
- In the custom sitemap file you created, specify the links you want to include in the sitemap. You can use the provided code snippet as a reference and adjust it according to your needs.
-
Include the New Sitemap in Rank Math:
- Once you have defined the new sitemap in the custom file, you need to include it in Rank Math.
- You can add the new sitemap link to your existing sitemap index file or create a separate sitemap index file that includes all your sitemaps, including the new
type-sitemap.xml
.
By following these steps, you can create a custom sitemap for a new category of pages on your site and include it in Rank Math for search engines to discover and index. If you need further assistance or detailed guidance, feel free to ask!
Sources:
What Are the SEO Benefits of Sitemaps? » Rank Math
How to Exclude Content From Sitemap » Rank Math
How to Create a Custom Sitemap and Include It in Rank Math » Rank Math
How to Configure Sitemaps in Rank Math – Best Settings and Tips
How to create page types on my site and define them in a separate sitemap. Currently there is a sitemap l page and post and I want to define another category of pages and create a separate sitemap for them
now i have
/page-sitemap.xml
/post-sitemap.xml
I would like to add e.g
/category-sitemap.xml
/type-sitemap.xml
How do you do that?
Hello,
Thank you for contacting us and bringing your concern to our attention.
Please note that Rank Math automatically creates sub-sitemaps according to your post-types. If you want to create the sub-sitemap for your category, please head over to your WP Dashboard > Rank Math > Sitemap Settings > Categories, and from there, enable the Include in Sitemap option.
Also, please make sure your category archive is set to index from Rank Math > Titles & Meta settings. Do the same for the other post types to create the sub sitemaps.
Hope that helps and please don’t hesitate to let us know if you have any other questions.
Thank you.
I don’t see the categories and the option to add them and also create a sitemap for them.
How to create new category
And how to create sitemap from then
Hello,
As we mentioned previously, our plugin automatically constructs the sub-sitemaps based from the available post type and taxonomy registered on your website. You can turn them on/off in the Sitemap settings as instructed.
If you wish to create a custom sitemap, this requires coding from your end which you can see here: https://rankmath.com/kb/custom-sitemaps/
Looking forward to helping you.
HOW TO CREATE NEW post type and taxonomy
After adding a post type as detailed here
https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/
Does your plugin create a separate sitemap for it automatically?
This link explains adding the “movie” type
So will there be a /movie-sitemap.xml after adding the post type or is there a need for further action?
Hello,
After registering the post type, you should enable the sitemap for that post type in Rank Math > Sitemap Settings > [Movie Post Type].
Once done, Rank Math will automatically create the sitemap like you have shared.
Looking forward to helping you.
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.