As the title says, I’ve got a multi-site setup with 18 sites and would like to combine the RSS feeds from all sites into the root site’s feed. The other feeds can still exists, that’s not a problem. Additionally, I’d like a way in the admin (on page/post edit, perhaps), to exclude certain posts from the feeds.
In addition to a custom plugin containing all the specialty widgets and core function overrides, we’re using a heavily customized theme as well. I’m using this code in my functions.php to pull all content types into RSS:
function custom_post_feeds($qv){
if (isset($qv['feed']))
$qv['post_type'] = get_post_types();
return $qv;
}
add_filter('request', 'custom_post_feeds');
Any ideas?
The bottom line is that you’ll need to have all the post content in one place in order to be able to form it into a single feed. (Querying efficiently across 18 different post tables is more or less impossible.) My go-to method is to use the Sitewide Tags plugin https://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/, which allows you to designate a “tags” blog, where a copy of every post on your network will be saved.
You could set your main site as the “tags” blog, but it’ll mean that you have to rig something up to keep the duplicated content out of your main feeds. (Such as a filter on guid, which the SWT plugin uses to point back to the original content.) Alternatively, you could just set up a separate “storage” blog for this purpose, and then point your RSS links to it (or
switch_to_blog()
in the context of your primary site).