How to filter popular posts by week, month Drupal

Updated: 25 October, 2021 seen 3,615

Previously I wrote a tutorial, how to filter popular posts on Drupal using Views, today I would like to show, how to filter popular posts in the time frame, in a week or in a month.

N.B. This tutorial will show how to filter posts on your Drupal site, by most viewed nodes based on their publishing date, not filter all nodes in some time frame.

If you haven't set up a popular blog post View, click on the link above, and set up your view.

  • Open your popular blog (posts) view:
  • Add new filter under Filter section: Content: Post date
  • On Filter, settings choose Operator: is between, in value, Min enter time frame you would like Drupal filters to apply, In my case I'm using -10 days offset, to filter posts on last 10 days, in value Max enter value now, so in case you have future posts it would limit this till actual time - now.

If you have any questions, please leave a comment below