Wordpress - Get all posts in RSS

A way to get your posts is to call the different pages of the rss feed in your newsletter generator. It's a safe approach that doesn't require to update your various Wordpress installations:

yourwebsite.com/feed -> get last 10 posts

yourwebsite.com/feed/?paged=2 -> get next 10 posts

And so on.


Codex has example snippet on how to use post_limits filter to override amount set in admin for feed.

if (isset ($query->query_vars['feed']) and ($query->query_vars['feed'] == 'ics')) 
    add_filter('post_limits','__return_empty_string'); 

http://codex.wordpress.org/Function_Reference/query_posts#Usage_Tips


Unfortunately, what you're trying to do is generally frowned upon in most communities. What I hear you asking for is:

  • A way to remotely retrieve more than the default number of (recent posts)
  • Possibly retrieve all published posts for a site
  • Without having any direct interaction with the site itself (using RSS)

This is a practice commonly used to scrape content from blogs and republish it without the permission of the original author. That's why I say it's generally frowned upon. Most blog authors put a lot of time and energy into developing great content, so making it easy for a third party to leverage their hard work to add SEO credit to their own site is ... well ... sleezy.

That said, I will assume for the moment that you have legitimate reasons for scraping content from over 700 sites. In that case, I would recommend a separate, programatic method - not RSS. If you have legitimate login information for all of these sites (i.e. they are your sites and not someone else's) you can use WordPress built-in XML-RPC features to fetch the content.

Use the built-in XML-RPC library to pass a request to metaWeblog.getRecentPosts specifying the ID of the blog (usually 0 for single sites, but could be different in multi-site), your WordPress username, your WordPress password, and the number of posts to fetch (set this to -1 to receive them all).

The other site will respond with (a rather large) XML file containing the content which you can do with what you want. This can all happen behind the scenes, and the metaWeblog.getRecentPosts request will give you much more information than an RSS feed (including custom fields, which might be important to you).

Tags:

Rss

Feed