Exclude Categories not working
-
I think there is problem with excluding categories. In my case I didn’t work.
I had a quick look in the code of sitemap-builder.php and I think I might have found the problem at line 93: the category-IDs are stored in term_taxonomy, the relation to the post in is the taxonomy_ID, not the category-ID.
I changed this (line 93):
$exCatSQL = "AND ( p.ID NOT IN ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN (" . implode(",", $excludedCategoryIDs) . ")))";
to that:
$exCatSQL = "AND ( p.ID NOT IN ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN ( SELECT term_taxonomy_id FROM {$wpdb->term_taxonomy} WHERE term_id IN ( " . implode(",", $excludedCategoryIDs) . "))))";
After this it worked for me.
(note: I only disable ONE Category, didn’t test several Categories)
- The topic ‘Exclude Categories not working’ is closed to new replies.