I’m using the WordPress XML-RPC to request posts. Works fine but is limited to 10 results. Trying to figure out how to increase this to save me scraping my own sitemap.
I haven’t delved into the back end of WordPress too much and I don’t use PHP beyond a few basics so I’m a little out of my comfort zone on this one. Started with the obvious settings -> reading and swapped pages to show and syndication feeds (just in case) to 100 items. No change.
Quick google shows the get_posts class even has ‘numberposts’ setting. Great. Looks simple enough. Can’t seem to figure out where this is actually set however. Dug around in wp-includes/rest-api nothing seems to reference get_posts. Same story with xmlrpc.php and wp-settings.php.
Apparently the default is set to 5 (unless this has changed in recent WordPress versions). The fact that 10 were returned and multiple questions like this make me wonder if this was being set in the theme code somewhere. But after looking through functions.php and a couple of the class pages not seeing any mention of get_posts either.
Would appreciate a prod in the right direction. Happy to do the digging just not sure where I should even be looking.
Read more here: Where Can I Find Get_Posts Settings?