Sitemap not working

#28756
Viewing 6 replies - 1 through 6 (of 6 total)
  • Todd
    Rank Math free

    Hi Huuti,

    Thanks for getting in touch with us.

    It seems to be working fine for us:
    null

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Huuti
    Rank Math free

    Hi Todd,

    there are over 3k pages on the site. They are not listed on the sitemap e.g https://huuti.co.uk/Get-a-mortgage.html

    and many more

    Hello,

    Thank you for contacting Rank Math today.

    The page that you have linked to seems like an external page on your site. Please note that Rank Math will only add the WP pages & posts that have been defined on your WP using the same permalink structure.

    I’ve checked your post and pages and you only have 4 WP pages listed as shown below:
    Screenshot

    I can suggest that you use the following filter to add the additional links to your sitemap file:

    /**
     * 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() {
      
    });
    function rank_math_add_custom_dynamic_url( $urls ) {
        $urls .= '
            http://www.mysite.com/dynamic-category1/
            2019-02-22T18:02:24+00:00
        ';
    
        $urls .= '
            http://www.mysite.com/dynamic-category2/
            2019-02-22T18:02:24+00:00
        ';
    
        return $urls;
    }

    Looking forward to helping you. Thank you.

    ​​​​​​

    Huuti
    Rank Math free

    Hi Michael,

    where would this filer be placed and will it be adding every additional page on a particular webpage or what is the logic?

    Todd
    Rank Math free

    Hi hutti,

    You have to place that code in your theme’s functions.php file.

    No, you have to add each URL manually.

    If you are adding any pages via WordPress, those will be automatically added to the sitemap.

    For generating a sitemap from non-WordPress pages – you can use this external service:
    https://pro-sitemaps.com/

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hello,

    Thank you for contacting Rank Math today.

    You will need to enter the links on each of your sitemaps by defining the {type} eg for the page-sitemap.xml, you can use the following example snippet on your theme’s functions.php file:

    /**
     * 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/page_content', function() {
      
    });
    function rank_math_add_custom_dynamic_url( $urls ) {
        $urls .= '
            https://huuti.co.uk/Get-a-mortgage.html
            2020-02-04T18:02:24+00:00
        ';
    
        $urls .= '
            http://www.mysite.com/dynamic-category2/
            2019-02-22T18:02:24+00:00
        ';
    
        return $urls;
    }

    Looking forward to helping you. Thank 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 6 replies - 1 through 6 (of 6 total)

The ticket ‘Sitemap not working’ is closed to new replies.