• Resolved Fibro Jedi

    (@fibrojedi)


    Hey,

    So, for context here. I have a custom post type that feeds into a database. For various reasons I have to create duplicates to account for variations in the data. Now, this causes duplicate content issues. I manage 301s via htaccess as that’s quicker than letting WordPress handle them. But a more ideal would be for them not to appear in the sitemap at all.

    I know there is a field to put post IDs into, but that’s not efficient. Would it be possible to add an option in the post editor panel – with the “index, noindex fields” to exclude or include in the sitemap please?

    I need my CPT to be in the sitemap, you see, but not the duplicates.

    If the option isn’t a viable addition, is there a way I could implement something on the post editor, like a shortcode that RM would interpret as “not-in-sitemap”? Thanks ??

    Edit: after a bit of digging I may have found something, but I’m not sure. Does marking a post as “noindex” also exclude/remove it from the sitemap?

    • This topic was modified 2 years ago by Fibro Jedi.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @fibrojedi,

    Thank you for contacting Rank Math support.

    Yes, Rank Math automatically removes the post from the sitemap if you set it to noindex in the robots meta.

    If you don’t prefer that way, at the moment, we have no immediate plan on adding “exclude post in sitemap” option in individual posts. You may refer to our filter code here if you wish to do that programmatically:
    https://rankmath.com/kb/filters-hooks-api-developer/#filter-sitemap-item

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

    Thread Starter Fibro Jedi

    (@fibrojedi)

    That does help, thank you. And yes, I may add that feature programmatically myself (via my own plugin/function). Thanks!

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @fibrojedi

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance. We are here to help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Feature Request] Exclude Post from Sitemap in Post editor’ is closed to new replies.