RSS feed item maximum length

Is there a length limit or maximum size for a description tag inside an RSS element?

Also, does this tag support HTML tags?

I will generate both <description> and <content:encoded> from the same HTML source code, and also would like to know if the <description> tag supports HTML.

+6
source share
1 answer

As I know, there are no length restrictions. 2

In RSS 0.91, various elements are limited to 500 or 100 characters. There can be no more than 15 <item> s in 0.91 <channel>. In RSS 0.92 and above, there are no restrictions on line length or XML level. Processors can impose their own limits, and generators can have preferences that say no more than a certain number of <item> s can appear in a channel or that lines are limited in length.

Rss 2.0

For all elements defined in the RSS specification that enclose character data, the text should be interpreted as plain text with the exception of the element description element, which should be a presentation as HTML. All of these items should not contain baby items.

There is no limit to the length of character data that can be contained in an RSS element.

So you want to cut text somewhere and add ...? In this case, just use substr.

 $description = substr($description, 0, 250)."..."; 

Replace 250 with your desired size.

+9
source

Source: https://habr.com/ru/post/904975/


All Articles