Issue with custom post type sitemap URL
-
Hello,
I have registered the custom post type Docs with post type key
my-prefix-doc
and I have also set the URL slug asdoc
.The code is looks like as below:
function prefix_register_name() { $args = array( .. 'rewrite' => array( 'slug' => 'doc', ), .. ); register_post_type( 'my-prefix-doc', $args ); } add_action( 'init', 'prefix_register_name' );
After doing this my sitemap URL for Docs is generated as below:
https://localhost/dev.fresh/my-prefix-doc-sitemap.xml
After visiting the above URL my docs are listed as below:
https://localhost/dev.fresh/doc/ https://localhost/dev.fresh/doc/first-doc/
This is as expected.
But, The post type URL is:
https://localhost/dev.fresh/my-prefix-doc-sitemap.xml
Which is expected as
doc
like below:https://localhost/dev.fresh/doc-sitemap.xml
So, Is there any way to chagne the
my-prefix-doc-sitemap.xml
withdoc-sitemap.xml
?I have a search in the codebase but not found any filter for this.
- The topic ‘Issue with custom post type sitemap URL’ is closed to new replies.