How to Change or Remove the WordPress Login Logo Link
June 6, 2024
This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.
Quick summary: Add two WordPress filters to your theme’s functions.php file to change the login page logo link and alt text. You can redirect it to your homepage, a custom URL, or remove the link entirely.
Why Change the Login Logo Link
By default, the WordPress login page shows the WordPress logo, and clicking it takes visitors to wordpress.org. That is fine for a personal blog, but if you are running a client site, a membership platform, or a business, that logo link is a branding gap and a security signal. It tells anyone who reaches the page that you are running WordPress.
Changing the logo link to your own homepage (or removing it) is a quick win. Combined with WP Ghost’s custom login path and the built-in Login Page Design feature, you can make your login page look completely custom without a separate plugin.
WP Ghost also includes a built-in option to replace the login logo and link without code. Check WP Ghost > Tweaks > Login Page Design and the WP Ghost > Advanced > Compatibility > Clean Login Page option before adding manual code. If those features cover your needs, you do not need the code snippets below.
| Login Page Element | Default (WordPress) | After Customization |
|---|---|---|
| Logo link destination | wordpress.org | Your homepage or custom URL |
| Logo alt text | “Powered by WordPress” | Your site name |
| WordPress fingerprint | Visible to anyone | Removed |
How to Access Your Theme’s functions.php File
You need to add a small code snippet to your active theme’s functions.php file. There are two ways to do this.
Option A: Through WordPress Dashboard
1. Go to Appearance > Theme File Editor.
2. In the file list on the right, click on functions.php.
3. Add your code at the bottom of the file, before the closing ?> tag (if one exists).
Option B: Through FTP or File Manager
1. Connect to your server using an FTP client or your hosting file manager.
2. Navigate to wp-content/themes/your-active-theme/.
3. Open functions.php for editing.
Use a child theme if you want your changes to survive theme updates. If your theme does not have a child theme, consider using a code snippets plugin instead.
Change the Logo Link to Your Homepage
Add this code to your functions.php file to make the login logo link point to your site’s homepage:
// Change the login page logo link to your homepage
function my_custom_login_url() {
return home_url();
}
add_filter( 'login_headerurl', 'my_custom_login_url' );The login_headerurl filter controls where the logo links to. The home_url() function returns your site’s homepage URL. You can replace home_url() with any URL string, like 'https://yourdomain.com/welcome', if you want it to go somewhere specific.
Remove the Logo Link Entirely
If you do not want the logo to link anywhere at all, use this one-liner:
add_filter( 'login_headerurl', '__return_false' );This makes the logo a plain image with no link. Clean and simple.
Change the Logo Alt Text to Your Site Name
The default alt text on the login logo says “Powered by WordPress.” You can change it to your site name using the login_headertext filter:
// Change the login logo alt text to your site name
function my_custom_login_title() {
return get_option( 'blogname' );
}
add_filter( 'login_headertext', 'my_custom_login_title' );The get_option('blogname') function pulls your site name from Settings > General > Site Title. You can also replace it with a hardcoded string like 'My Company Name'.
Note: Older tutorials reference the login_headertitle filter. That filter was deprecated in WordPress 5.2. Use login_headertext instead. Both still work for backward compatibility, but login_headertext is the correct hook going forward.
The Complete Snippet
Here is both changes combined into a single block you can copy and paste:
// Change the login page logo link to your homepage
function my_custom_login_url() {
return home_url();
}
add_filter( 'login_headerurl', 'my_custom_login_url' );
// Change the login logo alt text to your site name
function my_custom_login_title() {
return get_option( 'blogname' );
}
add_filter( 'login_headertext', 'my_custom_login_title' );Save and Verify
After adding the code, save your functions.php file. If you used the Theme File Editor, click Update File. If you used FTP, upload the modified file back to the server.
To verify the changes:
1. Log out of your WordPress dashboard.
2. Open your login page in a private browser window.
3. Hover over the logo and confirm it links to your homepage (or has no link).
4. Right-click the logo and check the alt text to confirm it shows your site name.
Frequently Asked Questions
Do I need this code if I use WP Ghost’s Login Page Design?
Not necessarily. WP Ghost’s Login Page Design feature lets you replace the logo and customize the entire login page visually from the dashboard. The Clean Login Page option in WP Ghost > Advanced > Compatibility also replaces the WordPress logo with your site logo automatically. Try those first. You only need this code if you want finer control over the link destination or alt text specifically.
Will this survive theme updates?
Only if you use a child theme. If you add code directly to your parent theme’s functions.php, a theme update will overwrite your changes. The safest approach is to use a child theme or a code snippets plugin that stores your custom code independently.
Is login_headertitle still valid?
It still works but it was deprecated in WordPress 5.2. The current filter is login_headertext. WordPress kept backward compatibility, so older code using login_headertitle will not break, but new code should use login_headertext.
Can I also change the logo image itself?
Yes, but that requires CSS rather than PHP filters. You would add a login_enqueue_scripts action that outputs custom CSS targeting the .login h1 a selector. However, WP Ghost’s Login Page Design feature handles this for you without any code. Go to WP Ghost > Tweaks > Login Page Design and upload your custom logo there.
Does changing the logo link improve security?
On its own, it is a minor improvement. It removes one visible WordPress fingerprint from the login page. The real security gains come from combining this with WP Ghost’s path security features: a custom login URL, brute force protection, and two-factor authentication. Together, those make your login page unfindable and unbreakable.
Does WP Ghost modify WordPress core files?
No. WP Ghost uses WordPress hooks and server rewrite rules. No core files are touched. The code snippets in this tutorial also use standard WordPress filters, which is the recommended way to customize login behavior.
Related Tutorials
For a complete login page transformation, explore these related features:
Change the WordPress Login Path – Hide wp-login.php behind a custom URL so bots cannot find your login page.
Change and Hide the wp-admin Path – Secure your admin dashboard URL alongside the login path.
Brute Force Attack Protection – Add CAPTCHA and rate limiting to protect your login form from automated attacks.
Two-Factor Authentication – Add 2FA by code, email, or passkey for an extra login security layer.
WP Ghost White Label – Fully rebrand the plugin including the login page logo for client sites.