Title: show_blog_form
Published: April 25, 2014
Last modified: February 24, 2026

---

# show_blog_form( string $blogname, string $blog_title, WP_Error|string $errors )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#wp--skip-link--target)

Generates and displays the Sign-up and Create Site forms.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#parameters)󠁿

 `$blogname`stringrequired

The new site name.

`$blog_title`stringrequired

The new site title.

`$errors`[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
|stringrequired

A [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/) object
containing existing errors. Defaults to empty string.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#source)󠁿

    ```php
    function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
    	if ( ! is_wp_error( $errors ) ) {
    		$errors = new WP_Error();
    	}

    	$current_network = get_network();
    	// Site name.
    	if ( ! is_subdomain_install() ) {
    		echo '<label for="blogname">' . __( 'Site Name (subdirectory only):' ) . '</label>';
    	} else {
    		echo '<label for="blogname">' . __( 'Site Domain (subdomain only):' ) . '</label>';
    	}

    	$errmsg_blogname      = $errors->get_error_message( 'blogname' );
    	$errmsg_blogname_aria = '';
    	if ( $errmsg_blogname ) {
    		$errmsg_blogname_aria = 'wp-signup-blogname-error ';
    		echo '<p class="error" id="wp-signup-blogname-error">' . $errmsg_blogname . '</p>';
    	}

    	if ( ! is_subdomain_install() ) {
    		echo '<div class="wp-signup-blogname"><span class="prefix_address" id="prefix-address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" required="required" aria-describedby="' . $errmsg_blogname_aria . 'prefix-address" /></div>';
    	} else {
    		$site_domain = preg_replace( '|^www\.|', '', $current_network->domain );
    		echo '<div class="wp-signup-blogname"><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" required="required" aria-describedby="' . $errmsg_blogname_aria . 'suffix-address" /><span class="suffix_address" id="suffix-address">.' . esc_html( $site_domain ) . '</span></div>';
    	}

    	if ( ! is_user_logged_in() ) {
    		if ( ! is_subdomain_install() ) {
    			$site = $current_network->domain . $current_network->path . __( 'sitename' );
    		} else {
    			$site = __( 'domain' ) . '.' . $site_domain . $current_network->path;
    		}

    		printf(
    			'<p>(<strong>%s</strong>) %s</p>',
    			/* translators: %s: Site address. */
    			sprintf( __( 'Your address will be %s.' ), $site ),
    			__( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' )
    		);
    	}

    	// Site Title.
    	?>
    	<label for="blog_title"><?php _e( 'Site Title:' ); ?></label>
    	<?php
    	$errmsg_blog_title      = $errors->get_error_message( 'blog_title' );
    	$errmsg_blog_title_aria = '';
    	if ( $errmsg_blog_title ) {
    		$errmsg_blog_title_aria = ' aria-describedby="wp-signup-blog-title-error"';
    		echo '<p class="error" id="wp-signup-blog-title-error">' . $errmsg_blog_title . '</p>';
    	}
    	echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" required="required" autocomplete="off"' . $errmsg_blog_title_aria . ' />';
    	?>

    	<?php
    	// Site Language.
    	$languages = signup_get_available_languages();

    	if ( ! empty( $languages ) ) :
    		?>
    		<p>
    			<label for="site-language"><?php _e( 'Site Language:' ); ?></label>
    			<?php
    			// Network default.
    			$lang = get_site_option( 'WPLANG' );

    			if ( isset( $_POST['WPLANG'] ) ) {
    				$lang = $_POST['WPLANG'];
    			}

    			// Use US English if the default isn't available.
    			if ( ! in_array( $lang, $languages, true ) ) {
    				$lang = '';
    			}

    			wp_dropdown_languages(
    				array(
    					'name'                        => 'WPLANG',
    					'id'                          => 'site-language',
    					'selected'                    => $lang,
    					'languages'                   => $languages,
    					'show_available_translations' => false,
    				)
    			);
    			?>
    		</p>
    		<?php
    		endif; // Languages.

    		$blog_public_on_checked  = '';
    		$blog_public_off_checked = '';
    	if ( isset( $_POST['blog_public'] ) && '0' === $_POST['blog_public'] ) {
    		$blog_public_off_checked = 'checked="checked"';
    	} else {
    		$blog_public_on_checked = 'checked="checked"';
    	}
    	?>

    	<div id="privacy">
    		<fieldset class="privacy-intro">
    			<legend>
    				<span class="label-heading"><?php _e( 'Privacy:' ); ?></span>
    				<?php _e( 'Allow search engines to index this site.' ); ?>
    			</legend>
    			<p class="wp-signup-radio-buttons">
    				<span class="wp-signup-radio-button">
    					<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> />
    					<label class="checkbox" for="blog_public_on"><?php _e( 'Yes' ); ?></label>
    				</span>
    				<span class="wp-signup-radio-button">
    					<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php echo $blog_public_off_checked; ?> />
    					<label class="checkbox" for="blog_public_off"><?php _e( 'No' ); ?></label>
    				</span>
    			</p>
    		</fieldset>
    	</div>

    	<?php
    	/**
    	 * Fires after the site sign-up form.
    	 *
    	 * @since 3.0.0
    	 *
    	 * @param WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors.
    	 */
    	do_action( 'signup_blogform', $errors );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-signup.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-signup.php#L117)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-signup.php#L117-L244)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#hooks)󠁿

 [do_action( ‘signup_blogform’, WP_Error $errors )](https://developer.wordpress.org/reference/hooks/signup_blogform/)

Fires after the site sign-up form.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#related)󠁿

| Uses | Description | 
| [get_network()](https://developer.wordpress.org/reference/functions/get_network/)`wp-includes/ms-network.php` |

Retrieves network data given a network ID or network object.

  | 
| [signup_get_available_languages()](https://developer.wordpress.org/reference/functions/signup_get_available_languages/)`wp-signup.php` |

Retrieves languages available during the site/user sign-up process.

  | 
| [wp_dropdown_languages()](https://developer.wordpress.org/reference/functions/wp_dropdown_languages/)`wp-includes/l10n.php` |

Displays or returns a Language selector.

  | 
| [is_subdomain_install()](https://developer.wordpress.org/reference/functions/is_subdomain_install/)`wp-includes/ms-load.php` |

Whether a subdomain configuration is enabled.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_e()](https://developer.wordpress.org/reference/functions/_e/)`wp-includes/l10n.php` |

Displays translated text.

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  | 
| [is_user_logged_in()](https://developer.wordpress.org/reference/functions/is_user_logged_in/)`wp-includes/pluggable.php` |

Determines whether the current visitor is a logged in user.

  | 
| [do_action()](https://developer.wordpress.org/reference/functions/do_action/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to an action hook.

  | 
| [get_site_option()](https://developer.wordpress.org/reference/functions/get_site_option/)`wp-includes/option.php` |

Retrieve an option value for the current network based on name of option.

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  | 
| [WP_Error::__construct()](https://developer.wordpress.org/reference/classes/wp_error/__construct/)`wp-includes/class-wp-error.php` |

Initializes the error.

  |

[Show 9 more](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#)

| Used by | Description | 
| [signup_another_blog()](https://developer.wordpress.org/reference/functions/signup_another_blog/)`wp-signup.php` |

Shows a form for returning users to sign up for another site.

  | 
| [signup_blog()](https://developer.wordpress.org/reference/functions/signup_blog/)`wp-signup.php` |

Shows a form for a user or visitor to sign up for a new site.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/show_blog_form/?output_format=md#changelog)󠁿

| Version | Description | 
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fshow_blog_form%2F)
before being able to contribute a note or feedback.