I want to filter sidebar content generated from dynamic_sidebar() and only return the last 2 calendar years of archives (not last 24 months).

Is it possible to do this sort of filtering and how?

1 Answer 1


There is no clean way to filter whole sidebar and such, but then that's not what you really need.

The calendar widget (assuming you mean native one) uses get_calendar() function, which passes result through get_calendar filter.

It would be preferable to filter its queries, but from quick look at the code they seem highly messy and not easy to override.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.