• Resolved PaulJBis

    (@pauljbis)


    Hello:

    I am using a third party theme that has a custom content type called “Team members”. The problem is that I want the content of that type to appear in the the sitemap, but not as “Team members”, but as “Guests”: I want the URLs to show “/guests/” instead of “/team-members/”.

    How can I use the developer filters to achieve this? Is there a specific filter?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @pauljbis

    Thanks for using the Yoast SEO plugin. There’s a developer filter to alter the URL structure, for example, of a custom post type. You can find more information here. I hope that points you in the right direction, but I’ll recommend testing it on a staging site, first

    Thread Starter PaulJBis

    (@pauljbis)

    Hello:

    Thanks for the link. I thought it might be just what I needed… but it didn’t work. Let me explain myself:

    I am using a theme that has a custom post type called “team members”. Using another plugin (Permalink manager), I managed to change all the URLs that have “team-members” in it to “guests”, and they appear as such in the sitemap too. The problem I’m having is with the names of the sitemaps themselves. In other words, if I open the main sitemap.xml, what I find is (among others) a link to a sitemap called:

    team-members-sitemap.xml

    And in this one, I find links like this:

    /team-members/

    /guests/guest-a/

    /guests/guest-b/

    And so on.

    I don’t know if this really matter Google-wise, but just in case, I would like the sitemap to be called “guests-sitemap” instead of “team-members-sitemap”. I have tried using the filter that you linked to in the docs (‘wpseo_xml_sitemap_post_url’), but it doesn’t seem to be firing when it comes to those those sitemaps.

    I have also tried to add a new post in that category (“team members”/”guests”) to force the sitemap to be regenerated, but it didn’t work either.

    Anything else I might try?

    Plugin Support Maybellyne

    (@maybellyne)

    Thanks for providing more explanation. We don’t have a specific filter for that.

    However, the sitemap-related files are under [plugin-folder]/inc/sitemaps/. And here’s an example of how someone else did it:?https://gist.github.com/mohandere/4286103ce313d0cd6549. Please note that I didn’t test this, so you might want to use it on a staging site first.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sitemap: how to rename content type’ is closed to new replies.