Using WordPress ‘bloginfo_rss()’ PHP function

The bloginfo_rss() WordPress PHP function is used to display the RSS container for the bloginfo function. This function can retrieve any information that the get_bloginfo() function can, however, when values are retrieved for use in feeds, all tags are stripped and characters are converted.

Usage

Here’s a simple usage of the function:

bloginfo_rss('name');

In the above line, ‘name’ is the site info to retrieve. This code will output the site’s name in an RSS-friendly format.

Parameters

  • $show (string, Optional): Defines the site info to retrieve. The default value is an empty string, which defaults to the site name. See get_bloginfo() for a list of possible values.

More information

See WordPress Developer Resources: bloginfo_rss()

This function is not deprecated as of the last update and is found in the wp-includes/general-template.php file. Related functions include get_bloginfo().

Examples

Display the site name in an RSS-friendly format

// This line will display the site name in an RSS-friendly format
bloginfo_rss('name');

Display the site description in an RSS-friendly format

// This line will display the site description in an RSS-friendly format
bloginfo_rss('description');

Display the site URL in an RSS-friendly format

// This line will display the site URL in an RSS-friendly format
bloginfo_rss('url');

Display the site’s WordPress URL in an RSS-friendly format

// This line will display the site's WordPress URL in an RSS-friendly format
bloginfo_rss('wpurl');

Display the site’s language setting in an RSS-friendly format

// This line will display the site's language setting in an RSS-friendly format
bloginfo_rss('language');