Index: src/wp-includes/class-wp-customize-nav-menus.php
===================================================================
--- src/wp-includes/class-wp-customize-nav-menus.php	(revision 46412)
+++ src/wp-includes/class-wp-customize-nav-menus.php	(working copy)
@@ -305,7 +305,7 @@
 	public function search_available_items_query( $args = array() ) {
 		$items = array();
 
-		$post_type_objects = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' );
+		$post_type_objects = $this->get_available_item_types( 'post_type' );
 		$query             = array(
 			'post_type'              => array_keys( $post_type_objects ),
 			'suppress_filters'       => true,
@@ -363,16 +363,21 @@
 		}
 
 		// Query taxonomy terms.
-		$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' );
-		$terms      = get_terms(
-			array(
-				'taxonomies' => $taxonomies,
-				'name__like' => $args['s'],
-				'number'     => 20,
-				'offset'     => 20 * ( $args['pagenum'] - 1 ),
-			)
-		);
+		$taxonomies = $this->get_available_item_types( 'taxonomy', 'object' );
 
+		if( empty( $taxonomies ) ) {
+			$terms = array();
+		} else {
+			$terms = get_terms(
+				array(
+					'taxonomy'   => $taxonomies,
+					'name__like' => $args['s'],
+					'number'     => 20,
+					'offset'     => 20 * ( $args['pagenum'] - 1 ),
+				)
+			);
+		}
+
 		// Check if any taxonomies were found.
 		if ( ! empty( $terms ) ) {
 			foreach ( $terms as $term ) {
@@ -864,6 +869,38 @@
 	}
 
 	/**
+	 * Get specific type from available item types.
+	 *
+	 * @since 5.4.0
+	 *
+	 * @param string $item_type  Item type. Can be `post_type` or `taxonomy`.
+	 * @param mixed  $return_key Return specific key of the item type array.
+	 *                           Default set to false which returns whole object.
+	 *
+	 * @return array
+	 */
+	public function get_available_item_types( $item_type, $return_key = false ) {
+		$item_types = array_filter(
+			$this->available_item_types(),
+			function( $item ) use ( $item_type ) {
+				return $item_type === $item['type'];
+			}
+		);
+
+		if( ! $return_key ) {
+			return $item_types;
+		}
+
+		return array_map(
+			function( $item ) use ( $return_key ) {
+				return $item[ $return_key ];
+			},
+			$item_types
+		);
+	}
+
+
+	/**
 	 * Add a new `auto-draft` post.
 	 *
 	 * @since 4.7.0
