How to edit custom post type URL in Rank Math Sitemap

#246562
  • Resolved Jacquas
    Rank Math free

    Hello, I am using some Custom Post Types and can not change their names because I am using a plugin for these. The issue is, Rank Math is showing Custom Post Type names in the Rank Math Sitemap. For example, it is showing like, /xyz-index.xml in /sitemap_index.xml. I want to edit that URL (/xyz-index.xml), I want to edit that xyz part because it is showing the exact custom post type name and I do not want to show it as it is. Is there any way to do that? Also kindly mention the code if one is required to put in function.php for its working.

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

    Thanks for contacting us and sorry for any inconvenience that might have been caused due to that.

    Please modify and use this filter in your theme’s functions.php file: https://rankmath.com/kb/filters-hooks-api-developer/#change-remove-archive-url

    This will allow you to change the URL of the post-type sitemap.

    Hope this helps. Let us know if you need any further assistance.

    Hi, thank you for replying. As I can see you mentioned the source to change or remove the Archive URL from Sitemap. I do not want to remove the URL but just want to change its slug. And, it is not an archive page, it is a custom post name. I am going to add my website sitemap URL in sensitive data, please check that and suggest me the exact code to add to change the slug. The code you mentioned in the source needs modification and I am not quite handy over it and may mess things up.
    Kindly check sensitive data.

    Hello,

    Sorry for the confusion but the URL of the sitemaps can not be changed as Rank Math generates the sitemaps on runtime and they can’t be found on your server.

    Please don’t hesitate to tell us if you need any further assistance.

    Thanks.

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

The ticket ‘How to edit custom post type URL in Rank Math Sitemap’ is closed to new replies.