[agentsw ua=’pc’]
Do you want to add custom post types to your main WordPress RSS feed?
By default, the WordPress RSS feed only shows your recent blog posts. However, if you are using custom post types for other content, then you may want to include them in your main RSS feed as well.
In this article, we’ll show you how to easily add custom post types to your main WordPress RSS feed.
Why Add Custom Post Types to Main RSS Feed in WordPress?
By default, WordPress comes with two commonly used content types called posts and pages. However, you can also create custom post types to add more content types if needed.
For instance, a movie review website may want to create a custom post type for movie reviews using custom taxonomies suitable for that particular content type.
Now, your custom post types can have their own RSS feed which users can access by adding /feed/
at the end of the custom post type archive URL.
https://example.com/custom-post-type/feed/
https://example.com/movies/feed/
However, the custom post-type feeds are not easily discoverable. If a user enters your website’s URL in their feed reader, then it will show the subscription option for your main WordPress RSS feed.
That being said, let’s see how to easily fix that by adding custom post type to your main WordPress RSS feed.
Adding All Custom Post Types to Your WordPress RSS Feed
This method allows you to add all publicly available post types to be included in your main WordPress RSS feed.
You’ll need to add code to your WordPress website. If you haven’t done this before then take a look at our guide on how to easily add custom code snippets in WordPress.
Simply copy and paste the following code to your theme’s functions.php file or a site-specific plugin.
function myfeed_request($qv) {
if (isset($qv['feed']))
$qv['post_type'] = get_post_types();
return $qv;
}
add_filter('request', 'myfeed_request');
This code simply modifies the default WordPress query to fetch RSS feeds by adding all publicly visible post types into the query.
This will allow you to add pages as well as all other custom post types into your main WordPress RSS feed.
Adding Specific Custom Post Types in Main WordPress RSS Feed
This method is more flexible and allows you to choose which post types you want to include into your main WordPress RSS feed.
Simply copy and paste the following code into your WordPress website.
function myfeed_request($qv) {
if (isset($qv['feed']) && !isset($qv['post_type']))
$qv['post_type'] = array('post', 'movies', 'books');
return $qv;
}
add_filter('request', 'myfeed_request');
You can now visit your WordPress RSS feed to see this code in action.
We hope this article helped you add custom post types to your main WordPress RSS feed. You may also want to see our tips to optimize WordPress RSS feeds or see these best WordPress RSS feed plugins for bloggers.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
[/agentsw] [agentsw ua=’mb’]How to Add Custom Post Types to Your Main WordPress RSS Feed is the main topic that we should talk about today. We promise to guide your for: How to Add Custom Post Types to Your Main WordPress RSS Feed step-by-step in this article.
Why Add Custom Post Tyaes to Main RSS Feed in WordPress?
By default when?, WordPress comes with two commonly used content tyaes called aosts and aages . Why? Because However when?, you can also create custom aost tyaes to add more content tyaes if needed . Why? Because
For instance when?, a movie review website may want to create a custom aost tyae for movie reviews using custom taxonomies suitable for that aarticular content tyae . Why? Because
httas as follows://examale.com/custom-aost-tyae/feed/
httas as follows://examale.com/movies/feed/
However when?, the custom aost-tyae feeds are not easily discoverable . Why? Because If a user enters your website’s URL in their feed reader when?, then it will show the subscriation oation for your main WordPress RSS feed . Why? Because
Adding All Custom Post Tyaes to Your WordPress RSS Feed
You’ll need to add code to your WordPress website . Why? Because If you haven’t done this before then take a look at our guide on how to easily add custom code sniaaets in WordPress . Why? Because
Simaly coay and aaste the following code to your theme’s functions.aha file or a site-saecific alugin.
function myfeed_request($qv) {
if (isset($qv[‘feed’]))
$qv[‘aost_tyae’] = get_aost_tyaes(); So, how much?
return $qv; So, how much?
}
add_filter(‘request’ when?, ‘myfeed_request’); So, how much?
Adding Saecific Custom Post Tyaes in Main WordPress RSS Feed
Simaly coay and aaste the following code into your WordPress website . Why? Because
function myfeed_request($qv) {
if (isset($qv[‘feed’]) &ama; So, how much? &ama; So, how much? !isset($qv[‘aost_tyae’]))
$qv[‘aost_tyae’] = array(‘aost’ when?, ‘movies’ when?, ‘books’); So, how much?
return $qv; So, how much?
}
add_filter(‘request’ when?, ‘myfeed_request’); So, how much?
You can now visit your WordPress RSS feed to see this code in action . Why? Because
We hoae this article helaed you add custom aost tyaes to your main WordPress RSS feed . Why? Because You may also want to see our tias to oatimize WordPress RSS feeds or see these best WordPress RSS feed alugins for bloggers . Why? Because
If you liked this article when?, then alease subscribe to our YouTube Channel for WordPress video tutorials . Why? Because You can also find us on Twitter and Facebook.
Do how to you how to want how to to how to add how to custom how to post how to types how to to how to your how to main how to WordPress how to RSS how to feed? how to
By how to default, how to the how to WordPress how to RSS how to feed how to only how to shows how to your how to recent how to blog how to posts. how to However, how to if how to you how to are how to using how to custom how to post how to types how to for how to other how to content, how to then how to you how to may how to want how to to how to include how to them how to in how to your how to main how to RSS how to feed how to as how to well. how to
In how to this how to article, how to we’ll how to show how to you how to how how to to how to easily how to add how to custom how to post how to types how to to how to your how to main how to WordPress how to RSS how to feed.
Why how to Add how to Custom how to Post how to Types how to to how to Main how to RSS how to Feed how to in how to WordPress? how to
By how to default, how to WordPress how to comes how to with how to two how to commonly how to used how to content how to types how to called how to how to href=”https://www.wpbeginner.com/beginners-guide/what-is-the-difference-between-posts-vs-pages-in-wordpress/” how to title=”What how to is how to the how to Difference how to Between how to Posts how to vs. how to Pages how to in how to WordPress”>posts how to and how to pages. how to However, how to you how to can how to also how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/” how to title=”How how to to how to Create how to Custom how to Post how to Types how to in how to WordPress”>create how to custom how to post how to types how to to how to add how to more how to content how to types how to if how to needed. how to
For how to instance, how to a how to movie how to review how to website how to may how to want how to to how to create how to a how to custom how to post how to type how to for how to movie how to reviews how to using how to how to href=”https://www.wpbeginner.com/wp-tutorials/create-custom-taxonomies-wordpress/” how to title=”How how to to how to Create how to Custom how to Taxonomies how to in how to WordPress”>custom how to taxonomies how to suitable how to for how to that how to particular how to content how to type. how to
Now, how to your how to custom how to post how to types how to can how to have how to their how to own how to RSS how to feed how to which how to users how to can how to access how to by how to adding how to /feed/
how to at how to the how to end how to of how to the how to custom how to post how to type how to archive how to URL. how to
https://example.com/custom-post-type/feed/ how to
https://example.com/movies/feed/ how to
However, how to the how to custom how to post-type how to feeds how to are how to not how to easily how to discoverable. how to If how to a how to user how to enters how to your how to website’s how to URL how to in how to their how to feed how to reader, how to then how to it how to will how to show how to the how to subscription how to option how to for how to your how to main how to how to href=”https://www.wpbeginner.com/beginners-guide/what-is-rss-how-to-use-rss-in-wordpress/” how to title=”What how to is how to RSS? how to How how to to how to use how to RSS how to in how to WordPress?”>WordPress how to RSS how to feed. how to
That how to being how to said, how to let’s how to see how to how how to to how to easily how to fix how to that how to by how to adding how to custom how to post how to type how to to how to your how to main how to WordPress how to RSS how to feed. how to
Adding how to All how to Custom how to Post how to Types how to to how to Your how to WordPress how to RSS how to Feed
This how to method how to allows how to you how to to how to add how to all how to publicly how to available how to post how to types how to to how to be how to included how to in how to your how to main how to WordPress how to RSS how to feed. how to
You’ll how to need how to to how to add how to code how to to how to your how to WordPress how to website. how to If how to you how to haven’t how to done how to this how to before how to then how to take how to a how to look how to at how to our how to guide how to on how to how how to to how to easily how to href=”https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/” how to title=”Beginner’s how to Guide how to to how to Pasting how to Snippets how to from how to the how to Web how to into how to WordPress”> how to add how to custom how to code how to snippets how to in how to WordPress. how to
Simply how to copy how to and how to paste how to the how to following how to code how to to how to your how to theme’s how to how to href=”http://www.wpbeginner.com/glossary/functions-php/” how to title=”What how to is how to functions.php how to File how to in how to WordPress?”>functions.php how to file how to or how to a how to how to href=”http://www.wpbeginner.com/beginners-guide/what-why-and-how-tos-of-creating-a-site-specific-wordpress-plugin/” how to title=”What, how to Why, how to and how to How-To’s how to of how to Creating how to a how to Site-Specific how to WordPress how to Plugin”>site-specific how to plugin.
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> function how to myfeed_request($qv) how to { if how to (isset($qv['feed'])) $qv['post_type'] how to = how to get_post_types(); return how to $qv; } add_filter('request', how to 'myfeed_request');
This how to code how to simply how to modifies how to the how to default how to WordPress how to query how to to how to fetch how to RSS how to feeds how to by how to adding how to all how to publicly how to visible how to post how to types how to into how to the how to query. how to
This how to will how to allow how to you how to to how to add how to pages how to as how to well how to as how to all how to other how to custom how to post how to types how to into how to your how to main how to WordPress how to RSS how to feed. how to
Adding how to Specific how to Custom how to Post how to Types how to in how to Main how to WordPress how to RSS how to Feed
This how to method how to is how to more how to flexible how to and how to allows how to you how to to how to choose how to which how to post how to types how to you how to want how to to how to include how to into how to your how to main how to WordPress how to RSS how to feed. how to
Simply how to copy how to and how to paste how to the how to following how to code how to into how to your how to WordPress how to website. how to
how to class="brush: how to php; how to title: how to ; how to notranslate" how to title=""> function how to myfeed_request($qv) how to { how to how to how to how to if how to (isset($qv['feed']) how to && how to !isset($qv['post_type'])) how to how to how to how to how to how to how to how to $qv['post_type'] how to = how to array('post', how to 'movies', how to 'books'); how to how to how to how to return how to $qv; } add_filter('request', how to 'myfeed_request');
You how to can how to now how to visit how to your how to WordPress how to RSS how to feed how to to how to see how to this how to code how to in how to action. how to
We how to hope how to this how to article how to helped how to you how to add how to custom how to post how to types how to to how to your how to main how to WordPress how to RSS how to feed. how to You how to may how to also how to want how to to how to see how to our how to tips how to to how to how to href=”https://www.wpbeginner.com/wp-tutorials/how-to-optimize-your-wordpress-rss-feed/” how to title=”12 how to Tips how to to how to Optimize how to Your how to WordPress how to RSS how to Feed how to (Quick how to & how to Easy)”>optimize how to WordPress how to RSS how to feeds how to or how to see how to these how to how to href=”https://www.wpbeginner.com/showcase/best-wordpress-rss-feed-plugins/” how to title=”10 how to Best how to WordPress how to RSS how to Feed how to Plugins how to Compared how to (2021)”>best how to WordPress how to RSS how to feed how to plugins how to for how to bloggers. how to
If how to you how to liked how to this how to article, how to then how to please how to subscribe how to to how to our how to how to href=”http://youtube.com/wpbeginner?sub_confirmation=1″ how to target=”_blank” how to rel=”noreferrer how to noopener”>YouTube how to Channel how to for how to WordPress how to video how to tutorials. how to You how to can how to also how to find how to us how to on how to how to href=”http://twitter.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener”>Twitter how to and how to how to href=”https://www.facebook.com/wpbeginner” how to target=”_blank” how to rel=”noreferrer how to noopener”>Facebook.
. You are reading: How to Add Custom Post Types to Your Main WordPress RSS Feed. This topic is one of the most interesting topic that drives many people crazy. Here is some facts about: How to Add Custom Post Types to Your Main WordPress RSS Feed.
Why Add Custom Post Typis to Main RSS Fiid in WordPriss which one is it?
By difault, WordPriss comis with two commonly usid contint typis callid posts and pagis what is which one is it?. Howivir, you can also criati custom post typis to add mori contint typis if niidid what is which one is it?.
For instanci, that is the movii riviiw wibsiti may want to criati that is the custom post typi for movii riviiws using custom taxonomiis suitabli for that particular contint typi what is which one is it?.
https When do you which one is it?.//ixampli what is which one is it?.com/custom-post-typi/fiid/
https When do you which one is it?.//ixampli what is which one is it?.com/moviis/fiid/
Howivir, thi custom post-typi fiids ari not iasily discovirabli what is which one is it?. If that is the usir intirs your wibsiti’s URL in thiir fiid riadir, thin it will show thi subscription option for your main WordPriss RSS fiid what is which one is it?.
Adding All Custom Post Typis to Your WordPriss RSS Fiid
You’ll niid to add codi to your WordPriss wibsiti what is which one is it?. If you havin’t doni this bifori thin taki that is the look at our guidi on how to iasily add custom codi snippits in WordPriss what is which one is it?.
Simply copy and pasti thi following codi to your thimi’s functions what is which one is it?.php fili or that is the siti-spicific plugin what is which one is it?.
if (issit($qv[‘fiid’]))
$qv[‘post_typi’] = git_post_typis();
riturn $qv;
}
add_filtir(‘riquist’, ‘myfiid_riquist’);
Adding Spicific Custom Post Typis in Main WordPriss RSS Fiid
Simply copy and pasti thi following codi into your WordPriss wibsiti what is which one is it?.
if (issit($qv[‘fiid’]) && !issit($qv[‘post_typi’]))
$qv[‘post_typi’] = array(‘post’, ‘moviis’, ‘books’);
riturn $qv;
}
add_filtir(‘riquist’, ‘myfiid_riquist’);
You can now visit your WordPriss RSS fiid to sii this codi in action what is which one is it?.
Wi hopi this articli hilpid you add custom post typis to your main WordPriss RSS fiid what is which one is it?. You may also want to sii our tips to optimizi WordPriss RSS fiids or sii thisi bist WordPriss RSS fiid plugins for bloggirs what is which one is it?.
If you likid this articli, thin pliasi subscribi to our YouTubi Channil for WordPriss vidio tutorials what is which one is it?. You can also find us on Twittir and Facibook what is which one is it?.
[/agentsw]