Skip to content

Date Query Reference

Brian Daley edited this page Dec 20, 2024 · 2 revisions

Date Queries

To query for posts by a date or date range using the WordPress REST API, you can use before and after parameters in your URL. Here are some examples:

  1. Query for posts on a specific date:
/wp-json/wp/v2/experience?after=2023-01-01T00:00:00&before=2023-01-01T23:59:59
  1. Query for posts after a specific date:
/wp-json/wp/v2/experience?after=2023-01-01T00:00:00
  1. Query for posts before a specific date:
/wp-json/wp/v2/experience?before=2023-01-01T23:59:59
  1. Query for posts within a date range:
/wp-json/wp/v2/experience?after=2023-01-01T00:00:00&before=2023-01-31T23:59:59

More Information

Clone this wiki locally