Do you wish to present content material solely to RSS subscribers in WordPress?
RSS (Actually Easy Syndication) is probably not as in style as social media, however some folks nonetheless use it to remain up-to-date on their favourite blogs. When you have RSS subscribers, then you may supply them unique content material.
On this article, we’ll present you methods to cover content material from common customers and solely present it to RSS subscribers in WordPress.
![How to Show Content Only to RSS Subscribers in WordPress How to Show Content Only to RSS Subscribers in WordPress](https://www.wpbeginner.com/wp-content/uploads/2016/06/show-content-only-to-rss-subscribers-in-post.png)
Why Present Unique Content material to WordPress RSS Subscribers?
Providing unique content material to RSS subscribers is usually a win-win to your WordPress web site.
For readers, it offers them a purpose to subscribe to your RSS feed, making certain they by no means miss your newest content material. This could possibly be something from early entry to new podcasts or an unique giveaway to win thrilling prizes.
As an internet site proprietor, rewarding reader loyalty can maintain customers engaged and coming again for extra, which will be useful for brand spanking new web sites attempting to construct a following.
![Example of a call-to-action inviting readers to subscribe via RSS Example of a call-to-action inviting readers to subscribe via RSS](https://www.wpbeginner.com/wp-content/uploads/2024/03/rss-feed-subscription-box-example-min.jpg)
![Example of a call-to-action inviting readers to subscribe via RSS Example of a call-to-action inviting readers to subscribe via RSS](https://www.wpbeginner.com/wp-content/uploads/2024/03/rss-feed-subscription-box-example-min.jpg)
With that in thoughts, let’s see how one can present content material solely to RSS subscribers in WordPress.
How one can Present Content material Solely to RSS Subscribers in WordPress
This tutorial requires including customized code to WordPress, particularly in your capabilities.php file. To make the method protected and beginner-friendly, we might be utilizing WPCode as a substitute of enhancing the file immediately.
WPCode is the very best code snippet plugin in the marketplace. It allows you to simply add code snippets to your web site with out coping with your WordPress theme information immediately. This manner, there’s a decrease likelihood of you breaking your web site or inflicting an enormous error.
Earlier than you comply with any of the strategies beneath, be certain to put in the WPCode plugin first. Each the professional and free versions of the plugin will work for this tutorial.
For step-by-step directions, take a look at our newbie’s information on methods to set up a WordPress plugin.
The entire tutorials beneath use the identical steps, however the code itself might be completely different, relying on the use case you decide.
After you put in the plugin, it’s good to go to Code Snippets » + Add Snippet from the WordPress dashboard. Then, choose ‘Add Your Customized Code (New Snippet)’ and click on the ‘Use snippet’ button.
![Adding a custom code snippet to WordPress Adding a custom code snippet to WordPress](https://www.wpbeginner.com/wp-content/uploads/2018/06/add-snippet-wpcode.png)
![Adding a custom code snippet to WordPress Adding a custom code snippet to WordPress](https://www.wpbeginner.com/wp-content/uploads/2018/06/add-snippet-wpcode.png)
Now, you may comply with one of many WordPress tutorials beneath. Be happy to make use of these fast hyperlinks to skip to the tactic you wish to use:
If you wish to create a daily weblog submit however embody an unique content material snippet simply to your RSS subscribers, then you should use this methodology.
This code will cover a particular submit content material snippet out of your common guests and present it to your RSS subscribers solely.
First, give your code snippet a reputation, like ‘Present Particular Content material for RSS.’ Then, change the Code Sort to ‘PHP Snippet.’
![Creating a custom code snippet to show exclusive content for RSS readers Creating a custom code snippet to show exclusive content for RSS readers](https://www.wpbeginner.com/wp-content/uploads/2024/03/wpcode-show-specific-content-min.png)
![Creating a custom code snippet to show exclusive content for RSS readers Creating a custom code snippet to show exclusive content for RSS readers](https://www.wpbeginner.com/wp-content/uploads/2024/03/wpcode-show-specific-content-min.png)
After that, go forward and add the next code into the Code Preview field:
perform wpb_showcontent_rss( $atts, $content material ) {
if ( is_feed() )
return $content material;
}
add_shortcode( 'showcontentrss', 'wpb_showcontent_rss' );
This perform checks if the present request is for an RSS feed. Whether it is, then the perform will show the content material that’s specified within the [showcontentrss]
shortcode tags.
As soon as the code is added, simply scroll right down to be sure that the Insert Methodology is ‘Auto Insert’ and the Location is ‘Run In all places.’
Then, click on the ‘Inactive’ toggle in order that it turns into ‘Energetic,’ and hit the ‘Save Snippet’ button.
![Saving a new snippet in WPCode Saving a new snippet in WPCode](https://www.wpbeginner.com/wp-content/uploads/2010/04/wpcode-save-snippet-min.png)
![Saving a new snippet in WPCode Saving a new snippet in WPCode](https://www.wpbeginner.com/wp-content/uploads/2010/04/wpcode-save-snippet-min.png)
Now, go forward and open the Gutenberg block editor to create a brand new WordPress submit. Attempt including blocks to it as regular.
Then, wherever on the web page, click on the ‘+’ add block button and choose the Shortcode block.
![Adding a shortcode block in Gutenberg Adding a shortcode block in Gutenberg](https://www.wpbeginner.com/wp-content/uploads/2024/03/shortcode-block-min.png)
![Adding a shortcode block in Gutenberg Adding a shortcode block in Gutenberg](https://www.wpbeginner.com/wp-content/uploads/2024/03/shortcode-block-min.png)
Inside your new shortcode block, simply add the [showcontentrss]
and [/showcontentrss]
tags. After that, you may write some content material in between these tags.
In our instance, we wrote: [showcontentrss]Save 50% off on WPForms with this unique WPForms coupon code: SAVE50[/showcontentrss]
![Adding shortcode tags to show exclusive content to RSS subscribers Adding shortcode tags to show exclusive content to RSS subscribers](https://www.wpbeginner.com/wp-content/uploads/2024/03/shortcode-example-min.png)
![Adding shortcode tags to show exclusive content to RSS subscribers Adding shortcode tags to show exclusive content to RSS subscribers](https://www.wpbeginner.com/wp-content/uploads/2024/03/shortcode-example-min.png)
For extra info, take a look at our newbies’ information on methods to add a shortcode in WordPress.
As soon as that’s performed, simply publish the submit. If you go to your WordPress web site like a daily customer, you received’t see the content material wrapped contained in the shortcode.
Nonetheless, in the event you open the WordPress weblog submit from an RSS feed reader, you will note it:
![Example of RSS-exclusive content made with WPCode Example of RSS-exclusive content made with WPCode](https://www.wpbeginner.com/wp-content/uploads/2024/03/feeder-example.png)
![Example of RSS-exclusive content made with WPCode Example of RSS-exclusive content made with WPCode](https://www.wpbeginner.com/wp-content/uploads/2024/03/feeder-example.png)
Do you wish to cover a complete weblog submit out of your common guests and solely present it to your RSS subscribers? If that’s the case, then you may merely comply with this methodology.
Step one is to provide your snippet a reputation, like ‘Exclude Particular Posts for RSS.’ Be sure that to additionally change the Code Sort to ‘PHP Snippet.’
![Adding custom code in WPCode to show blog posts only for RSS subscribers Adding custom code in WPCode to show blog posts only for RSS subscribers](https://www.wpbeginner.com/wp-content/uploads/2024/03/wpcode-exclude-posts-rss-min.png)
![Adding custom code in WPCode to show blog posts only for RSS subscribers Adding custom code in WPCode to show blog posts only for RSS subscribers](https://www.wpbeginner.com/wp-content/uploads/2024/03/wpcode-exclude-posts-rss-min.png)
Now, you will have to repeat this code and paste it into the Code Preview field:
perform excludePosts($question) {
// Verify if the question is for the house web page or an archive web page
if ($query->is_home() || $query->is_archive()) {
// Specify the IDs of the posts you wish to exclude
$excludedPosts = array(1, 2, 3); // Exchange 1, 2, 3 with the IDs of the posts you wish to exclude
$query->set('post__not_in', $excludedPosts);
}
return $question;
}
add_filter('pre_get_posts', 'excludePosts');
This perform specifies the IDs of the posts you wish to exclude from common viewing and present to RSS subscribers solely. Be sure that to interchange the ID numbers along with your chosen submit IDs.
If you’re undecided the place to seek out your submit IDs, you may learn our article on methods to discover submit, class, tag, feedback, or person ID in WordPress.
As soon as that’s performed, simply scroll right down to be sure that the Insert Methodology is ‘Auto Insert’ and the Location is ‘Run In all places.’ Then, make the code ‘Energetic,’ and click on the ‘Save Snippet’ button.
![Saving a new snippet in WPCode Saving a new snippet in WPCode](https://www.wpbeginner.com/wp-content/uploads/2010/04/wpcode-save-snippet-min.png)
![Saving a new snippet in WPCode Saving a new snippet in WPCode](https://www.wpbeginner.com/wp-content/uploads/2010/04/wpcode-save-snippet-min.png)
If the code works, then you definitely received’t see your weblog posts when seen in your browser, however you’ll be capable to see them in an RSS reader.
Observe that each time you publish a particular weblog submit for RSS subscribers, you will have to replace the array of submit IDs within the code snippet. However, in case you are not planning so as to add any new ones, then you definitely don’t have to do the rest.
You should utilize this remaining methodology in the event you resolve to group your RSS-only weblog posts into one class. The good thing about this feature is that you simply don’t should replace the code every time you create a brand new weblog submit for RSS subscribers.
Like earlier than, be certain to provide your code snippet a reputation (like ‘Exclude Submit Classes for RSS’) and alter the Code Sort to ‘PHP Snippet.’
![Adding custom code to only show blog posts from a specific category to RSS subscribers Adding custom code to only show blog posts from a specific category to RSS subscribers](https://www.wpbeginner.com/wp-content/uploads/2024/03/wpcode-exclude-post-categories-rss-min.png)
![Adding custom code to only show blog posts from a specific category to RSS subscribers Adding custom code to only show blog posts from a specific category to RSS subscribers](https://www.wpbeginner.com/wp-content/uploads/2024/03/wpcode-exclude-post-categories-rss-min.png)
Then, insert the next code into the Code Preview field:
perform excludeCategory($question) {
// Verify if the question is for the house web page or an archive web page
if ($query->is_home() || $query->is_archive()) {
// Exclude posts from a selected class by ID
$query->set('cat', '-1'); // Exchange '1' with the ID of the class you wish to exclude
}
return $question;
}
// Hook the perform to the 'pre_get_posts' filter
add_filter('pre_get_posts', 'excludeCategory');
This perform specifies the ID of the classes you wish to exclude from the general public and show in an RSS reader solely. Earlier than you activate this code, be certain to interchange the ‘1’ with the class ID and go away the ‘-‘ sprint signal as is.
If you find yourself performed, transfer down the web page to be sure that the Insert Methodology is ‘Auto Insert’ and the Location is ‘Run In all places.’ After that, go forward and make the code ‘Energetic’ and click on ‘Save Snippet.’
![Saving a new snippet in WPCode Saving a new snippet in WPCode](https://www.wpbeginner.com/wp-content/uploads/2010/04/wpcode-save-snippet-min.png)
![Saving a new snippet in WPCode Saving a new snippet in WPCode](https://www.wpbeginner.com/wp-content/uploads/2010/04/wpcode-save-snippet-min.png)
You’ll know that your code is successful in the event you can’t see the weblog posts in that class whenever you view them in a browser, however you may see them as feed gadgets in an RSS reader.
Now that we now have proven you methods to present content material solely to RSS subscribers in WordPress, let’s dive into some widespread questions on WordPress RSS feeds.
Are RSS feeds nonetheless in style?
RSS won’t be the most well liked pattern, however many individuals nonetheless use it to remain up-to-date on their favourite web sites. Consider it as a strategy to get notified about new posts with out checking every web site individually.
What are the advantages of WordPress RSS feeds?
The primary profit is new submit notifications. Subscribers can get automated alerts everytime you publish new content material, making certain they by no means miss one among your posts.
The second benefit is that RSS feeds might help with WordPress website positioning (search engine marketing). They will sign to engines like google that your web site is continually up to date with contemporary content material.
You may take a look at our fast and simple tricks to optimize your WordPress RSS feed for extra info.
The place can you discover your RSS feed URL in WordPress?
More often than not, WordPress may have already added an RSS feed to your web site. You solely have to entry it by including /feed
on the finish of your area identify. Typically, you will have so as to add /index.php/feed
if the primary possibility doesn’t work.
How do I permit customers to subscribe to my web site’s RSS feed?
Probably the greatest methods to permit customers to subscribe to your web site’s RSS feed is through the use of e mail advertising and marketing providers like Brevo. This platform can hook up with your web site’s feed and ship e mail notifications everytime you publish one thing new.
From there, you may join the e-mail advertising and marketing platform with a type plugin like WPForms to create a subscription type in your web site.
For extra info, see our article on methods to notify subscribers of latest posts in WordPress.
We hope this text helped you discover ways to present content material solely to RSS feed subscribers in WordPress. You might also wish to see our professional decide of the very best RSS feed plugins for WordPress and our step-by-step information on methods to enhance your WordPress pace and efficiency.
In the event you preferred this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You can even discover us on Twitter and Facebook.
Leave a comment