Title: wp_widget_rss_form
Published: April 25, 2014
Last modified: August 20, 2026

---

# wp_widget_rss_form( array|string $args, array $inputs = null )

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#wp--skip-link--target)

Displays RSS widget options form.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#description)󠁿

The options for what fields are displayed for the RSS form are all booleans and 
are as follows: ‘url’, ‘title’, ‘items’, ‘show_summary’, ‘show_author’, ‘show_date’.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#parameters)󠁿

 `$args`array|stringrequired

Values for input fields.

`$inputs`arrayoptional

Override default display options.

Default:`null`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#source)󠁿

    ```php
    function wp_widget_rss_form( $args, $inputs = null ) {
    	$default_inputs = array(
    		'url'          => true,
    		'title'        => true,
    		'items'        => true,
    		'show_summary' => true,
    		'show_author'  => true,
    		'show_date'    => true,
    	);
    	$inputs         = wp_parse_args( $inputs, $default_inputs );

    	$args['title'] = $args['title'] ?? '';
    	$args['url']   = $args['url'] ?? '';
    	$args['items'] = (int) ( $args['items'] ?? 0 );

    	if ( $args['items'] < 1 || 20 < $args['items'] ) {
    		$args['items'] = 10;
    	}

    	$args['show_summary'] = (int) ( $args['show_summary'] ?? $inputs['show_summary'] );
    	$args['show_author']  = (int) ( $args['show_author'] ?? $inputs['show_author'] );
    	$args['show_date']    = (int) ( $args['show_date'] ?? $inputs['show_date'] );

    	if ( ! empty( $args['error'] ) ) {
    		echo '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $args['error'] ) . '</p>';
    	}

    	$esc_number = esc_attr( $args['number'] );
    	if ( $inputs['url'] ) :
    		?>
    	<p><label for="rss-url-<?php echo $esc_number; ?>"><?php _e( 'Enter the RSS feed URL here:' ); ?></label>
    	<input class="widefat" id="rss-url-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][url]" type="text" value="<?php echo esc_url( $args['url'] ); ?>" /></p>
    <?php endif; if ( $inputs['title'] ) : ?>
    	<p><label for="rss-title-<?php echo $esc_number; ?>"><?php _e( 'Give the feed a title (optional):' ); ?></label>
    	<input class="widefat" id="rss-title-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][title]" type="text" value="<?php echo esc_attr( $args['title'] ); ?>" /></p>
    <?php endif; if ( $inputs['items'] ) : ?>
    	<p><label for="rss-items-<?php echo $esc_number; ?>"><?php _e( 'How many items would you like to display?' ); ?></label>
    	<select id="rss-items-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][items]">
    	<?php
    	for ( $i = 1; $i <= 20; ++$i ) {
    		echo "<option value='$i' " . selected( $args['items'], $i, false ) . ">$i</option>";
    	}
    	?>
    	</select></p>
    <?php endif; if ( $inputs['show_summary'] || $inputs['show_author'] || $inputs['show_date'] ) : ?>
    	<p>
    	<?php if ( $inputs['show_summary'] ) : ?>
    		<input id="rss-show-summary-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_summary]" type="checkbox" value="1" <?php checked( $args['show_summary'] ); ?> />
    		<label for="rss-show-summary-<?php echo $esc_number; ?>"><?php _e( 'Display item content?' ); ?></label><br />
    	<?php endif; if ( $inputs['show_author'] ) : ?>
    		<input id="rss-show-author-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_author]" type="checkbox" value="1" <?php checked( $args['show_author'] ); ?> />
    		<label for="rss-show-author-<?php echo $esc_number; ?>"><?php _e( 'Display item author if available?' ); ?></label><br />
    	<?php endif; if ( $inputs['show_date'] ) : ?>
    		<input id="rss-show-date-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][show_date]" type="checkbox" value="1" <?php checked( $args['show_date'] ); ?> />
    		<label for="rss-show-date-<?php echo $esc_number; ?>"><?php _e( 'Display item date?' ); ?></label><br />
    	<?php endif; ?>
    	</p>
    	<?php
    	endif; // End of display options.
    foreach ( array_keys( $default_inputs ) as $input ) :
    	if ( 'hidden' === $inputs[ $input ] ) :
    		$id = str_replace( '_', '-', $input );
    		?>
    <input type="hidden" id="rss-<?php echo esc_attr( $id ); ?>-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][<?php echo esc_attr( $input ); ?>]" value="<?php echo esc_attr( $args[ $input ] ); ?>" />
    		<?php
    	endif;
    	endforeach;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/widgets.php#L1712)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/widgets.php#L1712-L1779)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#related)󠁿

| Uses | Description | 
| [selected()](https://developer.wordpress.org/reference/functions/selected/)`wp-includes/general-template.php` |

Outputs the HTML selected attribute.

  | 
| [checked()](https://developer.wordpress.org/reference/functions/checked/)`wp-includes/general-template.php` |

Outputs the HTML checked attribute.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_e()](https://developer.wordpress.org/reference/functions/_e/)`wp-includes/l10n.php` |

Displays translated text.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  | 
| [wp_parse_args()](https://developer.wordpress.org/reference/functions/wp_parse_args/)`wp-includes/functions.php` |

Merges user defined arguments into defaults array.

  |

[Show 6 more](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#)

| Used by | Description | 
| [wp_dashboard_rss_control()](https://developer.wordpress.org/reference/functions/wp_dashboard_rss_control/)`wp-admin/includes/dashboard.php` |

Sets up the RSS dashboard widget control and $args to be used as input to [wp_widget_rss_form()](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/) .

  | 
| [WP_Widget_RSS::form()](https://developer.wordpress.org/reference/classes/wp_widget_rss/form/)`wp-includes/widgets/class-wp-widget-rss.php` |

Outputs the settings form for the RSS widget.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_widget_rss_form/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_widget_rss_form%2F)
before being able to contribute a note or feedback.