python-wordpress-xmlrpc icon indicating copy to clipboard operation
python-wordpress-xmlrpc copied to clipboard

How would I retrieve all posts?

Open neatville opened this issue 8 years ago • 3 comments

How would I get all posts, without having to check how many there are to begin with manually. I tried looking and searching the docs, with no luck. items = wp.call(GetPosts({'orderby': 'post_modified', 'number': 161}))

neatville avatar Feb 17 '17 07:02 neatville

The number filter is optional, should return all posts if not provided no? items = wp.call(GetPosts({'orderby': 'post_modified'}))

francescolorussi avatar Mar 07 '17 13:03 francescolorussi

No, by default it seems to return about 10 when I leave that out.

neatville avatar Mar 10 '17 01:03 neatville

You must pass an offset to iterate over all of them. Wordpress itself will not give you all on one request:

https://www.shift8web.ca/blog/use-python-connect-wordpress-site/

n3storm avatar Jul 24 '17 10:07 n3storm