How to exclude the main taxonomy page from sitemap ?
-
add_filter('rank_math/sitemap/exclude_post', function($exclude, $post) {
2
3 $excluded_urls = [
4 'https://site.com/blog/',
5 'https://site.com/case_studies/',
6 'https://site.com/services/',
7 'https://site.com/solutions/'
8 ];
9
10
11 $post_url = get_permalink($post->ID);
12
13
14 if (in_array($post_url, $excluded_urls)) {
15 return true;
16 }
17
18 return $exclude; // Возвращаем оригинальное значение
19}, 10, 2);These are the most important taxonomy pages that are created at once by wp. How can they be excluded from sitemap?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.