Custom Post Type Archive Pages: Remove from Sitemap No Index

#186329
Viewing 4 replies - 1 through 4 (of 4 total)
  • I checked this filter in more detail it does not apply to this issue at all. The original ticket should be re-opened as the solution is completely off topic.

    Brian
    Rank Math free

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    If you wish to remove a certain archive page from the sitemap you can use this filter to do so:

    add_filter( 'rank_math/sitemap/post_type_archive_link', function ( $link ) {
    
            //Add a conditional statement like:
    
     	if ( strpos( $link, '%listingLocation%' ) !== false ) {
     		return false;
     	}
    
    	return $link;
    } );

    In any case, you can use this filter if the archive page is defined within your WordPress: https://rankmath.com/kb/filters-hooks-api-developer/#exclude-taxonomy-from-sitemap.

    In both of these cases, you need to use conditional statements to define the specific pages you want to remove. If you are not familiar, you want to seek some help from a developer.

    We really look forward to helping you.

    Thank you.

    Thanks! I will give it a shot.

    Anas
    Rank Math business

    Hello,

    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 4 replies - 1 through 4 (of 4 total)

The ticket ‘Custom Post Type Archive Pages: Remove from Sitemap No Index’ is closed to new replies.