Duplicate Snippet
Embed Snippet on Your Site
Replace WordPress Logo on Login Page
Use your custom logo on the default login page, don't forget to edit the snippet...
Code Preview
php
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Didnt work
Hey there,
We’re sorry to hear the snippet did not work for you – did you replace the logo URL with your own logo URL in the code before activating the snippet?
Feel free to reach out at https://wpcode.com/contact and we’ll gladly help debug this further.
Hello,
Would it also be possible to add a code to replace the “Logo” “link”?
Thank you for the suggestion, we are going to look into what options we have to add such a snippet to the library.
add_filter( ‘login_head’, function () {
$custom_logo = ‘https://wpcode.com/wp-admin/images/wordpress-logo.svg’;
$logo_width = 84;
$logo_height = 84;
printf(
‘.login h1 a {background-image:url(%1$s) !important; margin:0 auto; width: %2$spx; height: %3$spx; background-size: 100%%;}’,
$custom_logo,
$logo_width,
$logo_height
);
}, 990 );
add_filter( ‘login_headerurl’, function () {
// Update this URL to the desired link when the logo is clicked
return ‘https://yourcustomurl.com’;
});
Hi Serkan,
Thank you for sharing this. We have a suggestion, if you don’t mind: Instead of adding the code here in a comment, can you please create a copy of this snippet using the Duplicate button on the top right and edit that with your suggestion? That way, it’s easier to share your version of the snippet.