diff --git wp-includes/general-template.php wp-includes/general-template.php
index 11d4b77ff4..52e1b662f7 100644
--- wp-includes/general-template.php
+++ wp-includes/general-template.php
@@ -175,11 +175,11 @@ function get_template_part( $slug, $name = null ) {
  * search. To give a few examples of what it can be used for.
  *
  * @since 2.7.0
+ * @since 5.2.0 the $args array paramiter was added in place of an $echo boolean flag.
  *
- * @param bool $echo Default to echo and not return the form.
- * @return string|void String when $echo is false.
+ * @param array $args Default args are to echo and include no custom label.
  */
-function get_search_form( $echo = true ) {
+function get_search_form( $args = array() ) {
 	/**
 	 * Fires before the search form is retrieved, at the start of get_search_form().
 	 *
@@ -192,6 +192,38 @@ function get_search_form( $echo = true ) {
 
 	$format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
 
+	/*
+	 * Back compat: to ensure previous uses of get_search_form continue to
+	 * function as expected we handle a value for $echo as though nothing has
+	 * changed. Then we deal with the $args array and cast it's defaults.
+	 */
+	$echo = true;
+	if ( false === $args ) {
+		$echo = false;
+	}
+	if ( ! is_array( $args ) ) {
+		// we can set an empty array and allow default args to take over.
+		$args = array();
+	}
+
+	// defaults are to echo and to output no custom label on the landmark.
+	$defaults = array(
+		'echo'  => $echo,
+		'label' => false,
+	);
+
+	// merge any args with the defaults.
+	$args = wp_parse_args( $args, $defaults );
+
+	/**
+	 * Filters the array of args used when generating the search form.
+	 *
+	 * @since 5.2.0
+	 *
+	 * @param array $args The array of args used when building the search form.
+	 */
+	$args = apply_filters( 'search_form_args', $args );
+
 	/**
 	 * Filters the HTML format of the search form.
 	 *
@@ -208,8 +240,16 @@ function get_search_form( $echo = true ) {
 		require( $search_form_template );
 		$form = ob_get_clean();
 	} else {
+		// form a string containaing a label to use for the search role.
+		if ( $args['label'] ) {
+			$label = 'aria-label="' . esc_attr( $args['label'] ) . '" ';
+		} else {
+			// if there is no custom label we can set a default here. ATM it is
+			// empty as there's uncertainty about what the default should be.
+			$label = '';
+		}
 		if ( 'html5' == $format ) {
-			$form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
+			$form = '<form role="search" ' . $label . 'method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
 				<label>
 					<span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
 					<input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" />
@@ -217,7 +257,7 @@ function get_search_form( $echo = true ) {
 				<input type="submit" class="search-submit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
 			</form>';
 		} else {
-			$form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
+			$form = '<form role="search" ' . $label . 'method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
 				<div>
 					<label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
 					<input type="text" value="' . get_search_query() . '" name="s" id="s" />
@@ -240,7 +280,7 @@ function get_search_form( $echo = true ) {
 		$result = $form;
 	}
 
-	if ( $echo ) {
+	if ( array_key_exists( 'echo', $args ) && $args['echo'] ) {
 		echo $result;
 	} else {
 		return $result;
