Make WordPress Core

#49647 closed enhancement (maybelater)

Extend REST API search endpoint with "after" and "before" which the posts endpoint already supports

Reported by: archon810 Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0
Component: REST API Keywords:
Focuses: Cc:



I'd like to use the search API but provide the after parameter. I was surprised to see there's no parity to posts and it's not supported.



Is there a reason most, if not all, params supported by posts aren't present in search? Can they be?


Change History (2)

#1 @SergeyBiryukov
21 months ago

  • Component changed from General to REST API

#2 @TimothyBlynJacobs
14 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed
  • Version changed from 5.3.2 to 5.0

Hi @archon810,

The purpose of the Search endpoint is to provide a unified, minimal interface for performing basic searches across a variety of different WordPress entities; it has been recently extended to support terms and post formats.

Searching by date isn't something that can be universally implemented.

I would instead recommend using the existing posts endpoint for performing those searches, or implementing a custom endpoint.

Note: See TracTickets for help on using tickets.