Change CPT slug in XML Sitemap
-
Problem Yoast SEO generates XML sitemap with links that lead to 404 errors.
Because I’m using WPML and some str_replace scripts in my functions.php to rewrite slugs/permalinks. The XML sitemap generator by Yoast SEO is not using those scripts in my functions.php, so it generates non-valid links.
My str_replace scripts is changing the custom post type slug:
English domain.com/news/taxo_en1/taxo_en2/title
Dutch domain.com/nl/nieuws/taxo_nl1/taxo_nl2/titel
And the XML Sitemap is showing this Dutch domain.com/nl/news/taxo_nl1/taxo_nl2/titel
Is there a way to change the generated links in the XML sitemap? With a wpseo_do_sitemap hook or?
- The topic ‘Change CPT slug in XML Sitemap’ is closed to new replies.