Title: Filter by Post Date
Last modified: August 21, 2016

---

# Filter by Post Date

 *  Resolved [mmaedler](https://wordpress.org/support/users/mmaedler/)
 * (@mmaedler)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/filter-by-post-date/)
 * Hi there,
 * first of all, thanks for an awesome extension to the WordPress base functionality!
 * I was wondering it it was possible to also filter by a date_query. For example,
   I am using the API to sync between two websites and the sync script runs once
   a day. To not having the sync script request all of the posts and check if they
   are synced already, I thought it might be a good idea to only request the posts
   written or modified after the sync script ran the last time.
 * Thanks!
 * [https://wordpress.org/plugins/json-rest-api/](https://wordpress.org/plugins/json-rest-api/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Ryan McCue](https://wordpress.org/support/users/rmccue/)
 * (@rmccue)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/filter-by-post-date/#post-5146641)
 * This is not currently possible, but we are [looking at adding it](https://github.com/WP-API/WP-API/issues/389)
   in a future release.
 *  Thread Starter [mmaedler](https://wordpress.org/support/users/mmaedler/)
 * (@mmaedler)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/filter-by-post-date/#post-5146643)
 * I fixed the issue by adding a custom filter:
 *     ```
       // Allow datequery in /posts filter
       	add_filter( "json_query_vars", function ($query_args) {
       		return array_merge($query_args, array("date_query"));
       	});
       ```
   
 * which I hope is fine.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filter by Post Date’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-rest-api_2e3641.svg)
 * [WP REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-rest-api/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mmaedler](https://wordpress.org/support/users/mmaedler/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/filter-by-post-date/#post-5146643)
 * Status: resolved