Index: src/wp-includes/js/media/views/attachments/browser.js
===================================================================
--- src/wp-includes/js/media/views/attachments/browser.js	(revision 41227)
+++ src/wp-includes/js/media/views/attachments/browser.js	(working copy)
@@ -20,6 +20,7 @@
  */
 var View = wp.media.View,
 	mediaTrash = wp.media.view.settings.mediaTrash,
+	showMonths = wp.media.view.settings.showMonths,
 	l10n = wp.media.view.l10n,
 	$ = jQuery,
 	AttachmentsBrowser;
@@ -157,19 +158,21 @@
 				priority: -90
 			}).render() );
 
-			// DateFilter is a <select>, screen reader text needs to be rendered before
-			this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
-				value: l10n.filterByDate,
-				attributes: {
-					'for': 'media-attachment-date-filters'
-				},
-				priority: -75
-			}).render() );
-			this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
-				controller: this.controller,
-				model:      this.collection.props,
-				priority: -75
-			}).render() );
+			if ( showMonths ) {
+				// DateFilter is a <select>, screen reader text needs to be rendered before
+				this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
+					value: l10n.filterByDate,
+					attributes: {
+						'for': 'media-attachment-date-filters'
+					},
+					priority: -75
+				}).render() );
+				this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
+					controller: this.controller,
+					model:      this.collection.props,
+					priority: -75
+				}).render() );
+			}
 
 			// BulkSelection is a <div> with subviews, including screen reader text
 			this.toolbar.set( 'selectModeToggleButton', new wp.media.view.SelectModeToggleButton({
@@ -278,7 +281,7 @@
 				}).render() );
 			}
 
-		} else if ( this.options.date ) {
+		} else if ( showMonths && this.options.date ) {
 			// DateFilter is a <select>, screen reader text needs to be rendered before
 			this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
 				value: l10n.filterByDate,
Index: src/wp-includes/js/media-views.js
===================================================================
--- src/wp-includes/js/media-views.js	(revision 41227)
+++ src/wp-includes/js/media-views.js	(working copy)
@@ -3751,6 +3751,7 @@
  */
 var View = wp.media.View,
 	mediaTrash = wp.media.view.settings.mediaTrash,
+	showMonths = wp.media.view.settings.showMonths,
 	l10n = wp.media.view.l10n,
 	$ = jQuery,
 	AttachmentsBrowser;
@@ -3888,19 +3889,21 @@
 				priority: -90
 			}).render() );
 
-			// DateFilter is a <select>, screen reader text needs to be rendered before
-			this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
-				value: l10n.filterByDate,
-				attributes: {
-					'for': 'media-attachment-date-filters'
-				},
-				priority: -75
-			}).render() );
-			this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
-				controller: this.controller,
-				model:      this.collection.props,
-				priority: -75
-			}).render() );
+			if ( showMonths ) {
+				// DateFilter is a <select>, screen reader text needs to be rendered before
+				this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
+					value: l10n.filterByDate,
+					attributes: {
+						'for': 'media-attachment-date-filters'
+					},
+					priority: -75
+				}).render() );
+				this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
+					controller: this.controller,
+					model:      this.collection.props,
+					priority: -75
+				}).render() );
+			}
 
 			// BulkSelection is a <div> with subviews, including screen reader text
 			this.toolbar.set( 'selectModeToggleButton', new wp.media.view.SelectModeToggleButton({
@@ -4009,7 +4012,7 @@
 				}).render() );
 			}
 
-		} else if ( this.options.date ) {
+		} else if ( showMonths && this.options.date ) {
 			// DateFilter is a <select>, screen reader text needs to be rendered before
 			this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
 				value: l10n.filterByDate,
Index: src/wp-includes/media.php
===================================================================
--- src/wp-includes/media.php	(revision 41227)
+++ src/wp-includes/media.php	(working copy)
@@ -3401,32 +3401,48 @@
 	}
 
 	/**
-	 * Allows overriding the list of months displayed in the media library.
+	 * Allows showing or hiding the months select in the media library.
 	 *
-	 * By default (if this filter does not return an array), a query will be
-	 * run to determine the months that have media items.  This query can be
-	 * expensive for large media libraries, so it may be desirable for sites to
-	 * override this behavior.
+	 * By default, the months select will always be shown in the media library
+	 * and a list of months will be generated to populate the select with.
+	 * If `false` is returned the 'media_library_months_with_files' filter
+	 * will not be run and no select will be shown.
 	 *
-	 * @since 4.7.4
+	 * @link https://core.trac.wordpress.org/ticket/41675
 	 *
-	 * @link https://core.trac.wordpress.org/ticket/31071
-	 *
-	 * @param array|null An array of objects with `month` and `year`
-	 *                   properties, or `null` (or any other non-array value)
-	 *                   for default behavior.
+	 * @param bool Whether or not to show the months select.
 	 */
-	$months = apply_filters( 'media_library_months_with_files', null );
-	if ( ! is_array( $months ) ) {
-		$months = $wpdb->get_results( $wpdb->prepare( "
-			SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
-			FROM $wpdb->posts
-			WHERE post_type = %s
-			ORDER BY post_date DESC
-		", 'attachment' ) );
-	}
-	foreach ( $months as $month_year ) {
-		$month_year->text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month_year->month ), $month_year->year );
+	$show_months_select = apply_filters( 'media_library_show_months_select', true );
+	$months = null;
+	if ( true === $show_months_select ) {
+		/**
+		 * Allows overriding the list of months displayed in the media library.
+		 *
+		 * By default (if this filter does not return an array), a query will be
+		 * run to determine the months that have media items.  This query can be
+		 * expensive for large media libraries, so it may be desirable for sites
+		 * to override this behavior.
+		 *
+		 * @since 4.7.4
+		 *
+		 * @link https://core.trac.wordpress.org/ticket/31071
+		 *
+		 * @param array|null An array of objects with `month` and `year`
+		 *                   properties, or `null` (or any other non-array value)
+		 *                   for default behavior.
+		 */
+		$months = apply_filters( 'media_library_months_with_files', null );
+		if ( ! is_array( $months ) ) {
+			$months = $wpdb->get_results( $wpdb->prepare( "
+				SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
+				FROM $wpdb->posts
+				WHERE post_type = %s
+				ORDER BY post_date DESC
+			", 'attachment' ) );
+		}
+		foreach ( $months as $month_year ) {
+			$month_year->text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month_year->month ), $month_year->year );
+		}
 	}
 
 	$settings = array(
@@ -3450,6 +3466,7 @@
 		'embedExts'    => $exts,
 		'embedMimes'   => $ext_mimes,
 		'contentWidth' => $content_width,
+		'showMonths'   => $show_months_select,
 		'months'       => $months,
 		'mediaTrash'   => MEDIA_TRASH ? 1 : 0,
 	);
