Filtering by the week of the year
With the Advanced Filter extension, a View can list only the entries for the current week, such as a team’s tasks or a weekly rota. The form saves a week number and a year with each entry, and the View compares them with today’s date, so the list changes every Monday without anyone editing the View.
Step 1: Add the week and year to the form #
- Edit the form and add a Number field labeled Week number.
- Under General, set Range to Min
1and Max53. - Under Advanced, set Default Value to
{today:format:W}, so the field starts at the current week. People can still change it, for example to plan a task for next week. - Add a second Number field labeled Year, with the Default Value
{today:format:o}. - Click Save Form.

{today} is the Gravity Forms merge tag for today’s date, and :format: takes a PHP date format. See {today} merge tags in the Gravity Forms documentation.
Wis the ISO-8601 week number. Weeks start on Monday, and week 1 is the week with the year’s first Thursday, so a year has 52 or 53 weeks.ois the year that week belongs to. Around New Year it can differ from the calendar year: January 1, 2027 is in week 53 of 2026. Useoin both places, neverY, so the week and its year always match.
Without the year, the View would also list the entries from the same week of every earlier year.
Step 2: Filter the View by the current week #
- Edit the View and click the Filter & Sort tab in the Settings box.
- Under Advanced Filter, click Add Condition. Set the condition to Week number and
is, and type{today:format:W}as the value. - Click + Condition and set it to Year,
is,{today:format:o}. - Check that AND is selected at the top of the group, so an entry has to match both conditions.
- Click Update.

The View now lists the entries of the current week. The week changes at midnight between Sunday and Monday in your site’s timezone, set in WordPress under Settings, then General.
Entries saved before you added the two fields have no week number or year. The View lists them only after you edit each one and fill in both.
Show this week and the weeks after it #
The merge tag can’t add or subtract weeks: a value such as {today:format:W|+2} is compared as the current week. To list this week and every later week of the year, use two groups:
- In the first group, add Week number
is{today:format:W}and Week numbergreater than{today:format:W}, and click OR at the top of the group. - Click + AND below the group, and in the new group add Year
is{today:format:o}. - Click Update.
Show each user their own tasks for the week #
When the form also has a field that stores a WordPress user ID, such as an Assigned to drop-down, the View can show each signed-in user only their tasks for the week. To fill a drop-down with your users, see Listing entries assigned to a specific user.
Add two more conditions to the group from Step 2:
- Assigned to
is. In the value list, pick Custom Value and type{user:ID}. - Current User Role
has ANY of, and the roles of everyone who uses the View, such as Editor and Subscriber.
Keep the Current User Role condition. For a visitor who isn’t signed in, {user:ID} is empty, so without it the View shows visitors every task of the week that has no one assigned. With it, visitors see no entries.
To let administrators see every task of the week, type {user:ID:disabled_admin} instead and include Administrator in the roles. See The :disabled_admin merge tag modifier.