Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between description and content:encoded tags in RSS2

Tags:

xml

rss

feed

rss2

What is the difference, if any, between the <description> tag and the <content:encoded> tag in RSS 2.0 format specifications?

Is one more important than the other?

Should I be using both in my feeds or one will suffice?

like image 664
2hamed Avatar asked Aug 28 '11 11:08

2hamed


Video Answer


1 Answers

The <description> tag is for the summary of the post, but in plain text only. No markup.

You can get around that if you escape the tags or wrap the content in:

<![CDATA[ post body goes <strong>here</strong> ]]> 

But you're not really supposed to be doing that.

If you want markup, you're supposed to use <content:encoded> and use the <![CDATA[ and ]]> wrappers here.

The content:encoded element can be used in conjunction with the description element to provide an item's full content along with a shorter summary. Under this approach, the complete text of the item is presented in content:encoded and the summary in description.

###RSS Best Practices Profile: content:encoded

In short, <description> is for the summary and the rest of the post is in <content:encoded>.

Since some readers may not support the tags as expected, you usually see the entire post in <description> and not a mix of the two.

like image 130
random Avatar answered Oct 05 '22 00:10

random