{"id":24464,"date":"2015-11-28T16:53:05","date_gmt":"2015-11-28T21:53:05","guid":{"rendered":"https:\/\/www.usefulblogging.com\/?p=24464"},"modified":"2026-02-08T03:24:17","modified_gmt":"2026-02-07T21:24:17","slug":"modify-the-login-logo-image-url-link-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.usefulblogging.com\/modify-the-login-logo-image-url-link-in-wordpress\/","title":{"rendered":"Modify the Login Logo &#038; Image URL Link in WordPress"},"content":{"rendered":"\n<p>Most of the users want to change the WordPress login logo to their own custom logo. But a part of them use third party plugins. Now, this code will allow you to easily modify the WordPress Login page Logo as well as the href link and title text of this logo without using any third party plugins.<\/p>\n\n\n\n<p><code><br>\nadd_filter( 'login_headerurl', 'namespace_login_headerurl' );<br>\n\/**<br>\n* Replaces the login header logo URL<br>\n*<br>\n* @param $url<br>\n*\/<br>\nfunction namespace_login_headerurl( $url ) {<br>\n$url = home_url( '\/' );<br>\nreturn $url;<br>\n}<br>\nadd_filter( 'login_headertitle', 'namespace_login_headertitle' );<br>\n\/**<br>\n* Replaces the login header logo title<br>\n*<br>\n* @param $title<br>\n*\/<br>\nfunction namespace_login_headertitle( $title ) {<br>\n$title = get_bloginfo( 'name' );<br>\nreturn $title;<br>\n}<br>\nadd_action( 'login_head', 'namespace_login_style' );<br>\n\/**<br>\n* Replaces the login header logo<br>\n*\/<br>\nfunction namespace_login_style() {<br>\necho '&lt;style&gt;.login h1 a { background-image: url( ' . get_template_directory_uri() . '\/images\/logo.png ) !important; }&lt;\/style&gt;';<br>\n} <\/code><br><strong>If you want to use the site logo to replace the login logo, you can use the following to dynamically pull that information.<\/strong><\/p>\n\n\n\n<p><code><br>\nfunction namespace_login_style() {<br>\nif( function_exists('get_custom_header') ){<br>\n$width = get_custom_header()-&gt;width;<br>\n$height = get_custom_header()-&gt;height;<br>\n} else {<br>\n$width = HEADER_IMAGE_WIDTH;<br>\n$height = HEADER_IMAGE_HEIGHT;<br>\n}<br>\necho '&lt;style&gt;'.PHP_EOL;<br>\necho '.login h1 a {'.PHP_EOL;<br>\necho '&nbsp; background-image: url( '; header_image(); echo ' ) !important; '.PHP_EOL;<br>\necho '&nbsp; width: '.$width.'px !important;'.PHP_EOL;<br>\necho '&nbsp; height: '.$height.'px !important;'.PHP_EOL;<br>\necho '&nbsp; background-size: '.$width.'px '.$height.'px !important;'.PHP_EOL;<br>\necho '}'.PHP_EOL;<br>\necho '&lt;\/style&gt;'.PHP_EOL;<br>\n}<br>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most of the users want to change the WordPress login logo to their own custom logo. But a part of &#8230; <a title=\"Modify the Login Logo &#038; Image URL Link in WordPress\" class=\"read-more\" href=\"https:\/\/www.usefulblogging.com\/modify-the-login-logo-image-url-link-in-wordpress\/\" aria-label=\"Read more about Modify the Login Logo &#038; Image URL Link in WordPress\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":24465,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[127],"tags":[10],"class_list":["post-24464","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-wordpress","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33","no-featured-image-padding"],"_links":{"self":[{"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/posts\/24464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/comments?post=24464"}],"version-history":[{"count":1,"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/posts\/24464\/revisions"}],"predecessor-version":[{"id":86298,"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/posts\/24464\/revisions\/86298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/media\/24465"}],"wp:attachment":[{"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/media?parent=24464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/categories?post=24464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.usefulblogging.com\/wp-json\/wp\/v2\/tags?post=24464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}