Do you need to present content material solely to RSS subscribers in WordPress?
RSS (Actually Easy Syndication) will not be as fashionable as social media, however some individuals nonetheless use it to remain up-to-date on their favourite blogs. In case you have RSS subscribers, then you may supply them unique content material.
On this article, we are going to present you the right way to disguise content material from basic customers and solely present it to RSS subscribers in WordPress.
Why Present Unique Content material to WordPress RSS Subscribers?
Providing unique content material to RSS subscribers could be a win-win in your WordPress web site.
For readers, it offers them a motive to subscribe to your RSS feed, making certain they by no means miss your newest content material. This might 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 could be useful for brand spanking new web sites making an attempt to construct a following.

With that in thoughts, let’s see how one can present content material solely to RSS subscribers in WordPress.
The way to 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 secure and beginner-friendly, we might be utilizing WPCode as a substitute of enhancing the file instantly.
WPCode is one of the 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 instantly. This manner, there’s a decrease likelihood of you breaking your web site or inflicting an enormous error.
Earlier than you observe any of the strategies beneath, make sure that to put in the WPCode plugin first. Each the professional and free variations of the plugin will work for this tutorial.
For step-by-step directions, try our newbie’s information on the right way to set up a WordPress plugin.
The entire tutorials beneath use the identical steps, however the code itself might be totally different, relying on the use case you decide.
After you put in the plugin, you could 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.

Now, you may observe one of many WordPress tutorials beneath. Be at liberty to make use of these fast hyperlinks to skip to the tactic you need to use:
If you wish to create a daily weblog put up however embody an unique content material snippet simply in your RSS subscribers, then you need to use this methodology.
This code will disguise a particular put up 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 Kind to ‘PHP Snippet.’

After that, go forward and add the next code into the Code Preview field:
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 all the way down to make it possible for the Insert Technique is ‘Auto Insert’ and the Location is ‘Run All over the place.’
Then, click on the ‘Inactive’ toggle in order that it turns into ‘Energetic,’ and hit the ‘Save Snippet’ button.

Now, go forward and open the Gutenberg block editor to create a brand new WordPress put up. Strive including blocks to it as typical.
Then, anyplace on the web page, click on the ‘+’ add block button and choose the Shortcode block.

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]

For extra data, try our learners’ information on the right way to add a shortcode in WordPress.
As soon as that’s finished, simply publish the put up. Whenever you go to your WordPress website like a daily customer, you gained’t see the content material wrapped contained in the shortcode.
Nonetheless, in the event you open the WordPress weblog put up from an RSS feed reader, you will notice it:

Do you need to disguise a complete weblog put up out of your common guests and solely present it to your RSS subscribers? In that case, then you may merely observe this methodology.
Step one is to offer your snippet a reputation, like ‘Exclude Particular Posts for RSS.’ Ensure to additionally change the Code Kind to ‘PHP Snippet.’

Now, you will want to repeat this code and paste it into the Code Preview field:
// 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 need to exclude
$excludedPosts = array(1, 2, 3); // Exchange 1, 2, 3 with the IDs of the posts you need 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 need to exclude from basic viewing and present to RSS subscribers solely. Ensure to switch the ID numbers together with your chosen put up IDs.
If you’re unsure the place to search out your put up IDs, you may learn our article on the right way to discover put up, class, tag, feedback, or consumer ID in WordPress.
As soon as that’s finished, simply scroll all the way down to make it possible for the Insert Technique is ‘Auto Insert’ and the Location is ‘Run All over the place.’ Then, make the code ‘Energetic,’ and click on the ‘Save Snippet’ button.

If the code works, you then gained’t see your weblog posts when considered in your browser, however you’ll be capable of see them in an RSS reader.
Word that each time you publish a particular weblog put up for RSS subscribers, you will want to replace the array of put up IDs within the code snippet. However, if you’re not planning so as to add any new ones, you then don’t must do the rest.
You should utilize this ultimate methodology in the event you resolve to group your RSS-only weblog posts into one class. The advantage of this feature is that you just don’t should replace the code every time you create a brand new weblog put up for RSS subscribers.
Like earlier than, make sure that to offer your code snippet a reputation (like ‘Exclude Publish Classes for RSS’) and alter the Code Kind to ‘PHP Snippet.’

Then, insert the next code into the Code Preview field:
// 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 need 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 need to exclude from the general public and show in an RSS reader solely. Earlier than you activate this code, make sure that to switch the ‘1’ with the class ID and depart the ‘-‘ sprint signal as is.
When you’re finished, transfer down the web page to make it possible for the Insert Technique is ‘Auto Insert’ and the Location is ‘Run All over the place.’ After that, go forward and make the code ‘Energetic’ and click on ‘Save Snippet.’

You’ll know that your code is successful in the event you can not see the weblog posts in that class once 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 the right way to present content material solely to RSS subscribers in WordPress, let’s dive into some frequent questions on WordPress RSS feeds.
Are RSS feeds nonetheless fashionable?
RSS may not be the most popular development, however many individuals nonetheless use it to remain up-to-date on their favourite web sites. Consider it as a method to get notified about new posts with out checking every website individually.
What are the advantages of WordPress RSS feeds?
The primary profit is new put up notifications. Subscribers can get computerized alerts everytime you publish new content material, making certain they by no means miss one in every of your posts.
The second benefit is that RSS feeds might help with WordPress search engine optimisation (SEO). They’ll sign to search engines like google and yahoo that your web site is continually up to date with contemporary content material.
You possibly can try our fast and simple tricks to optimize your WordPress RSS feed for extra data.
The place can you discover your RSS feed URL in WordPress?
More often than not, WordPress can have already added an RSS feed in your web site. You solely must entry it by including /feed on the finish of your area identify. Generally, you might 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?
The most effective methods to permit customers to subscribe to your web site’s RSS feed is through the use of electronic mail advertising providers like Brevo. This platform can hook up with your web site’s feed and ship electronic mail notifications everytime you publish one thing new.
From there, you may join the e-mail advertising platform with a type plugin like WPForms to create a subscription type in your website.
For extra data, see our article on the right way 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 may additionally need to see our knowledgeable decide of one of the best RSS feed plugins for WordPress and our step-by-step information on the right way to enhance your WordPress velocity and efficiency.
When you favored this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You may also discover us on Twitter and Fb.