Huh, never noticed the tag thing, I don’t use tags myself, I’m a bit of a Luddite 🙂 I’ve been here a while, and I still don’t quite understand the difference between Plugins & Hacks and just Hacks. Except that’s it’s quieter here and the questions are more interesting.
Anyway, there doesn’t appear to be any handy filter to change this behavior (though you could have code pick tags out of the final list, which has some issues IMO), so you should customize your feed to eliminate tags. Have a look at Customizing Feeds. If you look at the source for the default RSS2 feed template (/wp-includes/feed-rss2.php), the problem is the call to the_category_rss('rss2') (line 89).
This function is where the tags are combined, and there’s no simple way to change this behavior from within the function. You’ll need to replace this call with a call to a custom version that does not use tags. Copy the source from /wp-includes/feed.php (lines 355-408) to the top (after the initial comment) of your custom template. Give it a new function name, and use that name further down in place of the_category_rss('rss2').
Go through the code and remove anything related to tags, in a manner that doesn’t break anything else. I realize that can be a challenge, but the code is thankfully not too complex. You don’t need the line that calls get_the_tags() of course. Also remove (or simply comment out for easy reversion in case of error) the entire if ( !empty($tags) ) foreach... sequence (3 lines). Finally, you will not need the line that calls array_unique().
That should do it, good luck!
Hey bcworkz,
thanks for the reply and the time you took for checking this out. I did some testing and did the following:
– Copy the lines from feed.php en pasted them into feed-rss2.php
– Replaced the the_category_rss with the_headliner_rss in the copied code (2 times it needed to be replaced) and replaced it with line 89 in the feed-rss2.php
– Removed the get_the_tags and the three lines with the !empty
Of course I made backups, so i’m not messing anything up permanently, yet 🙂
I saved it, re-saved a post on the website so the RSS get generated again but the error below keeps popping up. I have tried to place the copies lines from the feed.php on different positions in the feed-rss2.php but no luck. So i think i’m close, but for some reason the definition of the_headlinder_rss isn’t defined.
For testing I also placed in the feed.php it self, but that also does not seem to work. Any ideas maybe?
Fatal error: Call to undefined function the_headliner_rss() in /var/www/vhosts/inthegame.nl/httpdocs/wp-includes/feed-rss2.php on line 141
Hi bcworkz,
fixed it! What was needed from the feed.php were some extra lines. From 355 not till 408 but till 420. Now the feed is working, without them categories!
Thanks a sh!tload for your time and effort.