• The situation:

    I have two basic WP-sites with some content. Now if I check their feeds (www.domain.com/feed) I get two different kind of outputs. Both of them do print out the XML structure, but Feed#1 is just plain text and Feed#2 is actual XML with syntax highlighting etc.

    There are also differences on how these two feeds are acting. If I save the Feed#1 from the browser to my computer, I get a file with no extension, but if I save the Feed#2 I get an actual XML file that has the .xml extension.

    Also Feed#2 can be viewed on pretty much every browser, but some browsers download Feed#1 instead of displaying its contents.

    Both feeds validate if I check them in a validator, so basically you could say they are working.

    But the actual problem that I’m having is that parsing the Feed#1 straight from the url (www.domain.com/feed) is a real pain in the ass, or actually impossible, because cURL just sees it as a blob of text inside a < pre>-element. Feed#2 can be easily parsed with cURL though.

    But why is this happening? I’ve developed tens of sites with WordPress and now that I’m checking their feeds, some are like Feed#1 and some are like Feed#2. Can it be because of the server settings maybe? At least there are no plugins that interfere with the feed output.

    • This topic was modified 4 years, 1 month ago by Tuuuukka.
    • This topic was modified 4 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 1 replies (of 1 total)
  • Thread Starter Tuuuukka


    Further inspection shows that the Feed#1 kind of feeds have their content-type set to “application/rss+xml” and Feed#2 have it set to “text/xml”.

    But why this is different on different sites, I do not know. Especially as I haven’t tampered with the feeds at all.

    The function feed_content_type() in feed.php seems to control the content-type:

    function feed_content_type( $type = '' ) {
    	if ( empty( $type ) ) {
    		$type = get_default_feed();
    	$types = array(
    		'rss'      => 'application/rss+xml',
    		'rss2'     => 'application/rss+xml',
    		'rss-http' => 'text/xml',
    		'atom'     => 'application/atom+xml',
    		'rdf'      => 'application/rdf+xml',
    	$content_type = ( ! empty( $types[ $type ] ) ) ? $types[ $type ] : 'application/octet-stream';
    	 * Filters the content type for a specific feed type.
    	 * @since 2.8.0
    	 * @param string $content_type Content type indicating the type of data that a feed contains.
    	 * @param string $type         Type of feed. Possible values include 'rss', rss2', 'atom', and 'rdf'.
    	return apply_filters( 'feed_content_type', $content_type, $type );

    This can of course be overridden, but I’m just curious on the whole situation here.

Viewing 1 replies (of 1 total)
  • The topic ‘Differences between default RSS feeds’ is closed to new replies.