• Resolved Mahesh Waghmare

    (@mahesh901122)


    Hello,

    I have registered the custom post type Docs with post type key my-prefix-doc and I have also set the URL slug as doc.

    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 with doc-sitemap.xml?

    I have a search in the codebase but not found any filter for this.

    • This topic was modified 5 years, 5 months ago by Mahesh Waghmare.
    • This topic was modified 5 years, 5 months ago by Mahesh Waghmare. Reason: Improve the formatting
    • This topic was modified 5 years, 5 months ago by Mahesh Waghmare. Reason: Improve the formatting
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Rank Math SEO

    (@rankmath)

    Hello @mahesh901122

    Thank you for contacting the support.

    Sorry to disappoint but we do not have any filter to change the behavior.

    Also, the index Sitemap is used for the reference and the inner Sitemaps contain all the posts.

    Hope that helps.

    Thread Starter Mahesh Waghmare

    (@mahesh901122)

    Okay. Thanks for the response. So, you can close and mark this topic as resolved.

    Plugin Author Rank Math SEO

    (@rankmath)

    Hello @mahesh901122

    We are super happy that this helped you. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://www.ads-software.com/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issue with custom post type sitemap URL’ is closed to new replies.