home page in both post and page sitemap.

#985292
  • Resolved Bheem
    Rank Math free

    Hi,
    I prefer to show latest posts on my site home page and hence, i donot have dedicated static homepage.
    The home page appears in both post and page sitemaps.
    how can i exclude homepage from post sitemap?

    regards

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

    We apologize for the issue you are facing with your homepage appearing in both the post and page sitemaps. To exclude your homepage from the post sitemap in Rank Math, you can follow these steps:

    1. Go to Rank Math Settings: In your WordPress dashboard, navigate to Rank Math > Sitemap Settings.
    2. Posts Tab: Click on the Posts tab where you can manage settings related to your posts.
    3. Exclude Homepage: Look for an option that allows you to exclude specific posts or pages from the sitemap. You may need to enter the ID of your homepage to exclude it. To find the ID of your homepage, go to Pages > All Pages, hover over your homepage, and note the ID from the URL shown in the status bar or by editing the page.
    4. Save Changes: After making the changes, don’t forget to click on the Save Changes button at the bottom right of the page.

    If you need further assistance or if this does not resolve your issue, please reply to this ticket, and a human agent from the Rank Math Support team will assist you further.

    Thank you for raising this concern!

    Sources:
    How to Configure Sitemaps in Rank Math – Best Settings and Tips

    Hello,

    Your homepage is also your archive page for your post type.

    To remove it from your post sitemap, you may need to use this filter:

    add_filter( 'rank_math/sitemap/post_type_archive_link', function( $archive_url, $post_type ){
    if ($post_type == 'post'){ // match to the actual post type name
    	$archive_url = false;
    }
    	return $archive_url;
    }, 10, 2 );

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

    Hope that helps.

    Bheem
    Rank Math free

    Hi, it did not work, i added using snippets.

    Hello,

    Please try to follow the steps below and see if that works for you:

    1. Flush the Sitemap cache by following this video screencast:
    https://i.rankmath.com/pipRDp

    2. Exclude the Sitemap files of the Rank Math plugin in your caching plugin. The cache could be via a plugin or from the server. For plugins or Cloudflare, please follow this article:
    https://rankmath.com/kb/exclude-sitemaps-from-caching/

    If that doesn’t work, then unfortunately, there is no way to remove your homepage from any specific sub-sitemap as it is both a static page (included in page-sitemap) and a posts page (included in post-sitemap).

    However, it shouldn’t affect your SEO as the sitemap is only a method to tell the search engines to crawl your pages.

    Hope that helps and please don’t hesitate to let us know if you have any other questions.
     
    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 4 replies - 1 through 4 (of 4 total)

The ticket ‘home page in both post and page sitemap.’ is closed to new replies.