Sitemap index urls

#798033
  • Resolved Anonymous
    Rank Math free

    m building some custom config based on index urls
    how to retrieve sitemap index urls / url list ?? get// from function/hook/filter

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    If you are looking to retrieve the sitemap index URLs or URL list programmatically using functions, hooks, or filters in Rank Math, you can achieve this by customizing the sitemap generation process.

    To create a custom sitemap and include it in Rank Math, you can follow these steps:

    1. Create a New File in the Child Theme:

      • Navigate to WordPress Dashboard → Appearance → Theme File Editor for Classic Themes or WordPress Dashboard → Tools → Theme File Editor for Block Themes.
      • Create a new file in your child theme folder and name it custom-sitemap.php.
      • Add the necessary code to this file. You can refer to this article for guidance on adding or creating filters in your theme files.
    2. Add Custom Links in get_sitemap_links() Function:

      • Replace the example.com URLs with your custom links in the get_sitemap_links() function.

    By customizing the sitemap generation process as described above, you can include your custom URLs in the sitemap index. This approach allows you to retrieve and include specific URLs in the sitemap index based on your requirements.

    For more detailed information and code snippets, you can refer to this guide on creating custom sitemaps in Rank Math.

    If you need further assistance or have any specific requirements, feel free to provide more details, and we’ll be happy to help.

    Thank you for reaching out with your query.

    Sources:
    How to Configure Sitemaps in Rank Math – Best Settings and Tips
    How to Create a Custom Sitemap and Include It in Rank Math » Rank Math

    Hello,

    Thank you so much for getting in touch.

    Rank Math generates the sitemaps virtual and it follows the current URL in your WordPress settings.

    You can check the path in Rank Math > Sitemap Settings:

    Rank Math support

    However, if you intend to modify the path, you can only change the base of the URL. Here’s how: https://rankmath.com/kb/filters-hooks-api-developer/#change-sitemap-base

    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.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘Sitemap index urls’ is closed to new replies.