Skip to content
Advertisement

How to get all categories of a wordpress site with rest api?

I’m trying to get all categories of my wordpress site with rest api :

JavaScript

But it only returns me the latest 10 by default .

Query

JavaScript

How can I get all categories of a wordpress site with rest api?

Advertisement

Answer

you can pass -1 in per_page argument for fetch all categories.

JavaScript

please check reference link: https://developer.wordpress.org/rest-api/reference/categories/#arguments

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement