WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to limit the amount of months shown in the Archive widget? I don't want to use a drop-down list (I can manually add a drop down in my footer so people can get the full archive). I'm currently showing 19 months in my Archive list, and want to limit it to 7. I know you can do this manually, but that would mess up my theme, so I wanted to do this with the Archive widget.

share|improve this question
up vote 1 down vote accepted

I would use the PHP Code Widget from Otto and then simply put this in the widget to limit the archives to 7 months:

<ul><?php wp_get_archives('type=monthly&limit=7'); ?></ul>

(Give the widget a title like Archives if you want, and remove the default WordPress Archive widget.)

Function Reference/wp get archives

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.