Add Custom Post Types to Main WordPress RSS Feed
Custom post types are a great feature introduced in WordPress 3.0 and it extended the functionality and practical usage of this awesome CMS. While re-designing / re-structuring iogoos.com, I have used Custom Post Types for different sections on this website.
Now I want to add all these custom post types to the main WordPress feed so the users get updated content from each section via RSS. There are two ways we can do that. You can add the below code snippets to the functions.php file of your theme.
1. Add all Custom Post Types to Main WordPress RSS Feed
function extend_feed($qv) {
if (isset($qv['feed']))
$qv['post_type'] = get_post_types();
return $qv;
}
add_filter('request', 'extend_feed');
Function get_post_types() will return all registered custom post types. Here you can learn more about get_post_types() function.
2. Add selected Custom Post Types to Main WordPress RSS Feed
I’ve used the woo-commerce plugin for the shop section of this website and this plugin added a few more custom post types that may be not relevant or useful for my readers. So with the code snippet below, we can add a few selected Custom Post Types to the main WordPress RSS Feed.
function extend_feed($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = array('post', 'tutorials', 'tips', 'snippets', 'shop');
return $qv;
}
add_filter('request', 'extend_feed');
If you notice, here instead of using the get_post_types() function, I supplied an array of specific custom post types slugs. This will add content to WordPress’s main RSS feed only from the specified post types.

Winery Website Development Services
Jewellery Website Development Services
Automotive Website Design Services
Drupal Website Development
Joomla Website Development
Webflow Development Services
Framer Website Development Services
WIX Development Services
Squarespace Development Services
AngularJS Website Development
ReactJS Development Services
IOS Apps Developmnet
Cross Platform App Development
Flutter App Development
Xamarin Apps Developmnet
Progressive Apps Developmnet
Prestashop Development Service
Neto (Maropost) Commerce Development Service
Shopify Plus Agency
Shopify Cro Services
Search Engine Optimization
Social Media Marketing
Paid Media Advertising
Google Ads Services
SEO Services India
Content Marketing Services
Email Marketing Services
SEO Pricing
Website Design Services India
Website Design Services USA Canada
Website Design Services British Columbia
Graphics Design Services
Logo Design
Figma To HTML5
Hire Remote Developers
Wearable App Development
Leave a Reply