Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Use your own logo and link on the login page

Make the WordPress login logo link to your homepage, show your site name as its title and use your site icon as the logo.

  • Type PHP
  • Runs Login page
PHP
// Link the login logo to your homepage instead of WordPress.org.
add_filter(
	'login_headerurl',
	function () {
		return home_url( '/' );
	}
);
add_filter(
	'login_headertext',
	function () {
		return get_bloginfo( 'name' );
	}
);

// Show your site icon as the logo, if you have set one (Settings > General).
add_action(
	'login_enqueue_scripts',
	function () {
		$icon = get_site_icon_url( 168 );
		if ( ! $icon ) {
			return;
		}
		wp_add_inline_style( 'login', '.login h1 a { background-image: url("' . esc_url_raw( $icon ) . '"); }' );
	}
);

What it does

The logo above the WordPress login form links to WordPress.org and shows the WordPress logo. For client sites it looks better to point to your own site.

This snippet links the logo to your homepage, uses your site name as its text, and shows your site icon instead of the WordPress logo if you've set one.

Good to know

  • If you haven't set a site icon, the WordPress logo stays and only the link and text change.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.