Custom Urls to Sitemap Index

#748696
  • Resolved N E
    Rank Math free

    CUSTOM URL SETS SITEMAP –

    IN RANKMATH SITEMAP INDEX ARE THEY VISIBLE?

    THEY ARE 9 SETS

    THIS URLS CAN BE FOUND THROUGH CUSTOM CODING…
    WHICH WE CAN

    NOW,
    WE WANT IT CATEGORIZED
    SO WE CAN EASILY CHECK..

    CURRENT SITEMAP INDEX
    //PRE DEFINED SETS
    A PRE DEFINED DEFAULTS
    B PRE
    C PRE
    CUSTOM-URLS-1
    CUSTOM-URLS-2

    THIS ARE DYNAMIC
    SO WHERE DO WE PUT IT??

    AND WHAT FILTER DO WE NEED TO DO IT…

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

    Thank you for reaching out with your question about adding custom URLs to the Sitemap Index in Rank Math.

    To add custom URLs to the Sitemap Index in Rank Math, you can follow these steps:

    1. Adding Custom URLs: You can include custom URLs in the sitemap by entering the custom field names in the respective fields provided by Rank Math. Make sure to add only one entry per line so that Rank Math can understand them better and include them in your sitemap.

    2. Visibility of Custom URLs in Sitemap Index: Once you have added the custom URLs, they should be visible in the Sitemap Index along with the pre-defined sets. You can categorize them for easy checking.

    3. Categorizing Custom URLs: To categorize the custom URLs and pre-defined sets in the Sitemap Index, you can organize them based on your requirements. This categorization will help you easily identify and manage the URLs.

    4. Dynamic Nature of Custom URLs: Since custom URLs are dynamic, you can update them as needed directly in Rank Math’s settings.

    5. Filtering Custom URLs: To filter and categorize the custom URLs and pre-defined sets effectively, you can use the filtering options available within Rank Math’s Sitemap settings. By organizing them into different sections or categories, you can easily manage and monitor the URLs in the Sitemap Index.

    If you need further assistance or detailed guidance on adding and categorizing custom URLs in the Sitemap Index, please feel free to reply to this ticket, and a human agent from our support team will assist you promptly.

    Thank you for your understanding and patience.

    Closing spiel.

    Sources:
    How to Configure Sitemaps in Rank Math – Best Settings and Tips
    Bulk Editing Options in the Rank Math SEO Plugin

    Hello,

    Thank you for contacting Rank Math support.

    To add custom URLs to your Rank Math sitemap, you can use the following filter:

    /**
     Filter to add extra URLs to the XML sitemap by type.
     *
     Only runs for the first page, not on all.
     *
     @param string $content String content to add, defaults to empty.
     */
    add_action( 'rank_math/sitemap/{$type}_content', function() {
    return '<url>
    <loc>https://rankmath.com/some-custom-url/</loc>
    <lastmod>2020-06-10T20:20:20+00:00</lastmod>
    </url>';
    });

    Replace {$type} with either post or page depending on if you want the URL to be included in the post or page sitemap – respectively.

    Here’s how you can add filter/hook to your WordPress site:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Once done, please flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    Let us know how it goes.

    Thank you.

    N E
    Rank Math free

    Can u tell us what does it mean (Only runs for the first page) not on all.??

    Predefined sets are the default sitemap generated through site map

    Custom URL – 1
    Custom URL – 2

    Are sets each set includes more than 1000 urls and still growing
    and we mean to say that this set of urls are basically type of cpt categories and we want to include it….

    N E
    Rank Math free

    like this-

    XML Sitemap
    This XML Sitemap is generated by Rank Math WordPress SEO Plugin. It is what search engines like Google use to crawl and re-crawl posts/pages/products/images/archives on your website.

    Learn more about XML Sitemaps.

    This XML Sitemap Index file contains 7 sitemaps.

    Sitemap Last Modified
    https://site.com/post-sitemap.xml
    2023-12-28 23:13 +00:00
    https://site.com/page-sitemap.xml
    2024-02-16 03:03 +00:00
    https://site.com/places-sitemap.xml
    2024-02-17 14:07 +00:00
    https://site.com/category-sitemap.xml
    2023-12-28 23:13 +00:00
    https://site.com/places_category-sitemap.xml
    2024-02-17 14:07 +00:00
    https://site.com/CUSTOM-URLS-A.xml
    https://site.com/CUSTOM-URLS-B.xml

    Hello,

    Thank you for your patience.

    In this case, you should follow this guide so you can include a custom sitemap in the Rank Math index sitemap:
    https://rankmath.com/kb/custom-sitemaps/

    The links inside the custom sitemap URLs should be added under this function:

    public function get_sitemap_links( $type, $max_entries, $current_page ) {

    Hope that helps.

    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 5 replies - 1 through 5 (of 5 total)

The ticket ‘Custom Urls to Sitemap Index’ is closed to new replies.