If you want to limit the number of months to only 12 for your Archive widget in your theme sidebar, use the widget_archives_args
filter to add the archives limit.
Insert the following code into the functions.php file of your theme.
function my_limit_archives( $args ) { $args['limit'] = 12; return $args; } add_filter( 'widget_archives_args', 'my_limit_archives' );
And to limit the number of months in Archives widget drop-down, use the following drop-down filter by replacing the last line of the above code.
add_filter( 'widget_archives_dropdown_args', 'my_limit_archives' );
We hope this helps!