exclude & flush/refresh

#382988
  • Hello –

    I have tried to refresh my sitemap following your instructions (increase post numbers – save, go to permalinks – change nothing save). It never refreshes.

    I have also tried to exclude posts for our client area – they still show up in the sitemap and I don’t want them to. I have this in my “exclude posts” field:
    322,527,355,358,525,240609,240643,240664,240362,240353,240331,240303,223257

    You really should specify if we need spaces or not – since you didn’t I have no spaces.

    I have this in “exclude terms” (since yesterday) : 53,95
    but since I can’t flush / refresh the sitemap I don’t know if that worked.

    We use kinsta – they claim there is no caching on our staging area – and none of the problems are from their end. How to I refresh then? Also how to I properly exclude posts? (I don’t want any of the “categories” from our client area showing up in the sitemap.

Viewing 16 replies (of 16 total)
  • Hello,

    The first parameter of the function has_term() can accept an array of terms instead of a single one, so you could potential do something like this:

    
    add_filter( 'rank_math/sitemap/entry', function( $url, $type, $object ){
    
        $post_id = $object->ID;
    
        if( has_term( [111, 112, 113], 'category', $post_id ) ) {
            $url = false;
        }
    
        return $url;
    }, 10, 3 );
    

    Don’t hesitate to get in touch if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 16 replies (of 16 total)

The ticket ‘exclude & flush/refresh’ is closed to new replies.