Title: [Plugin: WordPress RSS Shortcode] Limit RSS Feed Quantity
Last modified: August 20, 2016

---

# [Plugin: WordPress RSS Shortcode] Limit RSS Feed Quantity

 *  Resolved [InHouse](https://wordpress.org/support/users/inhouse/)
 * (@inhouse)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/)
 * Hi, I’m using the WordPress RSS Shortcode plugin and I am wondering how I can
   limit the quantity of posts that come in. So far I don’t see this option and 
   I’ve googled how to do modify the code myself with no luck. Thanks in advance!
 * This is the code so far:
 *     ```
       function rsstag($atts) {
       	$atts = shortcode_atts(array(
       		'url' => get_bloginfo('rss2_url'),
       		'show_author' => 0,
       		'show_date' => 1,
       		'show_summary' => 0
       	), $atts);
       	//var_dump($atts);
       	ob_start();
       	wp_widget_rss_output($atts['url'], $atts);
       	$rss = ob_get_contents();
       	ob_end_clean();
       	return $rss;
       }
       add_shortcode('rsstag', 'rsstag');
       ```
   
 * [http://wordpress.org/extend/plugins/wordpress-rss-shortcode/](http://wordpress.org/extend/plugins/wordpress-rss-shortcode/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [katmac_aus](https://wordpress.org/support/users/katmac_aus/)
 * (@katmac_aus)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/#post-2590747)
 * This RSS looked great as you could have date as option but I also need to set
   a limit!
 * Hope to hear an answer soon.
 *  [carlfj](https://wordpress.org/support/users/carlfj/)
 * (@carlfj)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/#post-2590753)
 * The plugin from yoast.com has this function. But not the ability to show author
   or date.
    [http://wordpress.org/extend/plugins/rss-shortcode/](http://wordpress.org/extend/plugins/rss-shortcode/)
 * I modified it for my own use so I could change the list format to just add custom
   delimiters instead, in this case commas. Furthermore the ability to skip some
   of the posts, e.g. to be able to just show post 6-10.
 * Let me know if this extension is to any use for you, I’d be happy to share it.
 * Regards, Carl
 *  [scamartist26](https://wordpress.org/support/users/scamartist26/)
 * (@scamartist26)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/#post-2590761)
 * Hey guys, a couple things about this that I have found.
 * 1. To limit item entries, the code should be changed to this:
 *     ```
       function rsstag($atts) {
       	$atts = shortcode_atts(array(
       		'url' => get_bloginfo('rss2_url'),
                       'items' => '5',
       		'show_author' => 0,
       		'show_date' => 1,
       		'show_summary' => 0
       	), $atts);
       	//var_dump($atts);
       	ob_start();
       	wp_widget_rss_output($atts['url'], $atts);
       	$rss = ob_get_contents();
       	ob_end_clean();
       	return $rss;
       }
       add_shortcode('rsstag', 'rsstag');
       ```
   
 * This defaults to 5 entries displayed, and will give you the ability to put items
   =# in the shortcode to put a manual limit of entries displayed.
 * 2. The URL must have AMPERSANDS encoded to %26 otherwise you may not get the 
   correct feed.
 * Cheers, hope that helps.
 *  [scamartist26](https://wordpress.org/support/users/scamartist26/)
 * (@scamartist26)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/#post-2590762)
 * One other thing to note, the URL may note work if you put the comma delimiter
   at the end without a space.
 * Example:
    **WRONG** [rsstag url=http://example.com, items=7] **CORRECT** [rsstag
   url=http://example.com , items=7]
 *  Thread Starter [InHouse](https://wordpress.org/support/users/inhouse/)
 * (@inhouse)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/#post-2590763)
 * Right on, thanks a lot scamartist26. That works perfectly!
 *  [scamartist26](https://wordpress.org/support/users/scamartist26/)
 * (@scamartist26)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/#post-2590764)
 * I may have been too speedy with my response here, LOL.
 * My code is sloppy, there should not be the single quotes around the integer after
   the items key. Like so
 * `'items' => 5,`
 * It will still work, but is not best practice.
 * Also, the shortcode does not need , delimiters, the documentation led me wrong.
   Those can be left out all together.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: WordPress RSS Shortcode] Limit RSS Feed Quantity’ is closed 
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-rss-shortcode.svg)
 * [Wordpress RSS Shortcode](https://wordpress.org/plugins/wordpress-rss-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-rss-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-rss-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-rss-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-rss-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-rss-shortcode/reviews/)

## Tags

 * [limit](https://wordpress.org/support/topic-tag/limit/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [quantity](https://wordpress.org/support/topic-tag/quantity/)

 * 6 replies
 * 4 participants
 * Last reply from: [scamartist26](https://wordpress.org/support/users/scamartist26/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpress-rss-shortcode-limit-rss-feed-quantity/#post-2590764)
 * Status: resolved