Purely Space logo
Yes, you can develop multiple websites without needing to code! We show you how.

How to put a Read More link in an RSS feed

Twitter share Share on Linked In Face Book Share

Last updated on .

So, you're wondering how to include a "Read More" link in your RSS feed. Yes, that's something you can do quite easily once you know how. Here we explain how to do it.

This explanation is applicable to those who are generating their feed text programmatically. This would apply if you're building a flat file from scratch without a CMS, or if you're using a system which lets you have a ton of control over how you do everything (e.g. ProcessWire).

By contrast, if you're using WordPress or other software that generates your RSS feed for you, the result will be theme-specific or software-specific. For WordPress, you can take a look at how your RSS feed looks by going to yoursite.com/feed

Even though virtually no-one uses RSS feeds directly or with a feed reader (that's really old-style), newsletters use these all the time. If you're sending a newsletter containing the latest news on your website to your subscribers and you want to automate that process, then no matter what mailing system you use, it'll pull your updates from your RSS feed. So your RSS feed is very important if you're sending out a newsletter to subscribers.

What a typical feed item looks like

Here is a typical feed item, without a Read More link in the description. Don't get overwhelmed, just glance at it briefly so you're aware of the syntax:

<item>
<title>
How to enjoy solitude
</title>
<description>
No matter where you are, it's important to enjoy knowing how to spend some time alone. Here are some helpful tips to enjoy your alone time without getting bored or lonely.
</description>
<link>
https://examplesite.com/enjoy-solitude
</link>
<pubDate>Thu, 23 Apr 2020 17:07:34 +0000</pubDate>
</item>

Why a "read more" link is important to have in the item description

It's paramount traffic-wise for you to have a Read More link in your RSS feed. I discovered that from experience. The auto-newsletter updates I sent subscribers were being pulled from my RSS feed, which is the way it's normally done. The problem was that without a "read more" link, my subscribers were getting a link only in the title of my article. They could see and read the description, but there was no link at the end of the description saying "read more" where you would expect it, the way a blog post excerpt would have done. Instead, readers had to click on the title of the newsletter item. The problem with that was that it wasn't really obvious to anyone that the title was clickable! Needless to say, very few subscribers would click through to my content.

Yet, if I included links directly in the <description> field, it wouldn't work - often the feed reader couldn't even see the description field as valid in that situation, which it wasn't - and we'll show you how to fix that.

How to put in the Read More link in the item description field

The answer is very simple: enclose the field that contains links in CDATA. You would do it like this: <![CDATA[whatever you want to put]]>

So your field would be generated to look like this:

<description><![CDATA[<p>
No matter where you are, it's important to enjoy knowing how to spend some time alone. Here are some helpful tips to enjoy your alone time without getting bored or lonely.<a href='https://examplesite.com/enjoy-solitude'>Read more...</a></p>
]]></description>

The feed reader will render the Read More link normally into a clickable link.

So that's how it's done, simply enclose the text in CDATA tags.

Helpful tips

If generating the RSS feed programmatically, I prefer to store the entirety of the desired description from <p> to </p> (including the Read More link) in a variable. Suppose this variable is called $excerpt

In that case, when generating the description field for each item, simply use this code:

echo "<description><![CDATA[" . $excerpt . "]]></description> \n";

Be sure to check your feed with an RSS feed validator after you make any changes. A couple of good validators are:

Conclusion

It's very easy to include a Read More link in an RSS feed. Simply enclose the text in CDATA tags as shown above.


Earn extra with a website

Smiley faces - how to earn extra with a website

If you'd like to do something fun that could earn you some money, but you don't want much risk or investment, then running a website is the perfect small business for you. We show you for free with step-by-step illustrations exactly how to get started. There are multiple different types of websites (not just blogs!) that you can select from. Check out our beginner's tutorial here!

Twitter share Share on Linked In Face Book Share

 

↑ top