Many pages marked as ‘no-index’ are still showing up in my sitemap

#139581
  • I updated the permalinks, refresh the CDN, etc. Nothing works… most of my pages show up in the sitemap, even if they are marked as no-index.

    Interestingly, on my staging domain, it works better… Not perfectly, but better. For some reason it’s still slow to update the sitemap, even after updating the permalinks (and I have no CDN or such there) then on the proper domain, after cloning the staging website there, the sitemaps aren’t right.

    I’m also trying to add dynamicly created page’s URL to the sitemap using this code, but it’s not working:

    /**
    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() {
    return ‘<url>
    <loc>https://element.how/addon-finder/elementor-audio-player/</loc&gt;
    <lastmod>2021-21-22T18:02:24+00:00</lastmod>
    </url>
    ‘;
    });

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    To exclude your posts/pages in your sitemap, please head over to WordPress Dashboard > Rank Math > Sitemap Settings > General.

    Exclude Post Page Sitemap

    And, here’s how you find the post/page ID inside WordPress: https://mythemeshop.com/blog/how-to-find-post-category-tag-comments-or-user-id-in-wordpress/

    For adding dynamically created pages URL to your sitemap, please refer to this 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 '         https://rankmath.com/some-custom-url/
             2020-02-20T20:20:20+00:00     
    ';
     }); 

    And this should go to your theme’s functions.php file.

    I hope that helps. Thank you, and looking forward to your update.

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

The ticket ‘Many pages marked as ‘no-index’ are still showing up in my sitemap’ is closed to new replies.