I’m trying to get all categories of my wordpress site with rest api :
axios.get('https://../wp-json/wp/v2/categories').then((res) => {
console.log(res.data);
});
But it only returns me the latest 10 by default .
Query
/wp-json/wp/v2/categories
How can I get all categories of a wordpress site with rest api?
you can pass -1 in per_page argument for fetch all categories.
please check reference link:
https://developer.wordpress.org/rest-api/reference/categories/#arguments