I have been meddling with REST API and I am stuck with this: How can I filter posts in both cat1 and cat2?

For now, ?categories[]=45&categories[]=50 returns in category ID 45 OR 50 - how can I get posts in 45 AND 50?

Thanks in advance.

  • Have you found a solution for this? – Corey Feb 3 '17 at 17:03
  • @Corey: Nopes. Guess it's not possible,as of now (saw some other plugin support posts claiming that) I was using API for an app with Ionic, I loaded them separately and intersected instead. Leaving it open, in case my learning is incomplete. Did read somewhere where Plugin is edited (not at all recommended) to achieve it. – Jesse P Francis Feb 5 '17 at 15:17

@Jesse see: WP-API/WP-API#2990

Since WP 4.7, filter has been removed from WP-API.

You need to use this plugin: https://github.com/WP-API/rest-filter


Multiple categories can be separated by comma like below


hope this helps


You should be able to access multiple categories by using the following:


Hope that helps!



Install the filter plugin Austin mentioned (https://github.com/WP-API/rest-filter) and try ?filter[categories]=cat_one_slug%2Bcat_two_slug.

I found out that %2B is the code equivalent of the + symbol.

Normally we would use + for the AND operator but unfortunately it gets converted into a space so use %2B instead.


This is what I did, It works fine.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.