A plugin to add date_query to the list of allowed filters for the REST API so we can filter by date after/before.
As of April 2026, date_query enabler is a WordPress api plugin with 10 active installations and a 5/5 rating from 2 reviews. It has been downloaded 1.5K+ times in total. Requires WordPress false+ and PHP false+. Available on WordPress.org since 2016. Last updated 10 years ago — may have compatibility concerns. Top alternative: WP Consent API.
WP REST API plugin provides the ability to interact with a WordPress installation through a REST API. When retrieving posts, a use case would be to filter them based on they publish date by before/after a certain date. In WordPress this can be achieved using the date_query parameter. However, the parameter is not part of the whitelisted parameters of WP REST API. A workaround is to add it ourselves as discussed here. This plugin adds the date_query param to the whitelist not modifying the theme of WordPress but by using a very small and simple plugin. This allows to change and upgrade themes freely and still keep the whitelisting of the parameter.
After installing WP REST API and this plugin, you should be able to run queries like the below,
/wp-json/wp/v2/posts?filter[date_query][after]=…| WordPress | false+ requiredTested up to 4.3.34 |
| PHP | false+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.