Really Simple Syndication or RSS may not be as popular as it used to be, but it's still a fantastic tool for engaging with your audience. While the obvious goal is to get as many eyes as possible on your content, how can you get there?

One solution is to offer exclusive content on your WordPress blog. New visitors are therefore encouraged to subscribe to your RSS feed, and old readers stay happy. It's a win-win.

In this article, we will discuss how to create exclusive content for your RSS feed, starting with a discussion about the pros and cons in details.

The benefits of creating exclusive content for your RSS Feed on WordPress

Many people no longer value RSS feeds, but we tend to disagree with them for the following reasons:

  • RSS feeds always offer readers an ideal way to catch up on all the latest content they have missed.
  • RSS feeds provide a cleaner reading experience than many websites.
  • Most modern feed readers offer advanced sharing features, retaining the benefits of promotion on social media.
  • WordPress generates feeds for your sites automatically, so handling this process as a webmaster is a snap.

The first three points have a common result (an improved experience for your visitors). The RSS feed will provide your audience with a better way to digest your content, so the smart WordPress webmaster will be able to find a way to put this up on his site.

In addition, creating exclusive content for your visitors serves a distinct purpose: it encourages your audience that is not part of your RSS subscribers to do so.

How to create exclusive content for your blog's RSS feed

In this section, we will enter the " nuts and bolts » the creation of exclusive content for your RSS feed as well as the exclusion of certain categories of your blog to avoid redundancy. This will give you total control over the RSS experience of your blog.

Step # 1: Configure the content you deem exclusive

The method here is quite simple: we will modify our file « functions.php To add a new feedonly shortcode, which will allow you to display only certain content only for subscribers to the RSS feed.

We will use Divi for both examples. Before doing anything, rest assured to have made a complete backup of your website!

First, open your favorite FTP client (We recommend FileZilla), Access your file « public_html "And then go to" Wp-content / themes / Divi »And find the file« functions.php Which is there. Open it with your text editor of choice and add the following code snippet at the bottom:

Function feedonly_shortcode ($ atts, $ content = null) {if (! Is_feed ()) return ""; Return $ content; } Add_shortcode ('feedonly', 'feedonly_shortcode');

After saving your changes, your new shortcode should be ready to use. To try it, try your site's RSS feed on an RSS reader. If your site URL is " exemple.com », Your feed will be« exemple.com/feed ". WordPress will do it automatically for you. Here is an example:

rss-feed-wordpress

Now, let's take a look at the WordPress post editor, using the Divi Builder. To keep things as simple as possible in this example, there are only two modules: Text and Code.

manufacturer-divi-theme-wordpress

The first contains only a bit of text for our example (inside the code module), however this is our exclusive RSS content:

Content-rss-exclusive-divi-theme-wordpress

What is in this module will not be visible for regular visitors, but for all those who will access the RSS feed.

Step 2 #: Exclude Categories to Refine Your Exclusive Content

Now that we know how to hide sections of our articles for regular visitors, we will now show you how to exclude certain categories from the RSS feed. This way, you will be able to ensure that only the best content will be delivered to subscribers of the RSS feed.

The first step is to identify the categories that you want to exclude from your RSS feed. Now in "Articles> Categories" on your WordPress dashboard you need to create a new one. Then click on the link for the category and observe the URL for the category. You should see a URL similar to this: example.com/wp-admin/term.php?taxonomy=category&tag_ID=6.

In our case, the category identifier turned out to be " 6 ". Keep that in mind and take a look at the code we need to add to the functions.php:

function excludeCategory ($ query) {if ($ query-> is_home | $ query-> is_archive) $ query-> set ('cat', '- 6'); return $ query; } add_filter ('pre_get_posts', 'excludeCategory');

Note that this section of the code in particular: $ query-> set ('cat', '-6') ;. Here we are telling our RSS feed to ignore this particular category. The negative value is extremely important. If you set the value positive, you are likely to crash your site.

After saving your file functions.php », All articles that you post on this specific category, will not appear on your RSS feed.

That's it for this tutorial. I hope it will allow you to add exclusive content to your RSS feed.