WordPress: How to fix the URL displaying on the wp-login page

July 15, 2012

After a recent update of WordPress I noticed on several of my sites that the blog URL was showing in the upper left corner of the page. A quick peek at the generated HTML source code showed me that the URL was being printed just before the closing head tag, all by its lonesome. This vexed me. After comparing several client sites I realized it was only happening on sites with custom login pages. Luckily Kailey Lampert, a noted WordPress guru in the area, lent me her brain and eyeballs and quickly sorted the issue. It seems that with several of the themes and plugins the filters ‘login_headerurl’ and ‘login_headertitle’ were being utilized. Further investigation showed that the sites with issues were echoing back their contents instead of returning it as a filter should properly do. Apparently in previous versions of WordPress this was ok, but with 3.4 it began to cause problems. If you are experiencing this same issue the fix is pretty simple, find where those filters are used and make sure they return instead of echo. So far that has worked on 100% of my sites. The resulting code should look similar to the following:

function prefix_wp_login_url() {
	return 'Whatever URL you want to use here';
}
add_filter('login_headerurl', 'prefix_wp_login_url');

function prefix_wp_login_title() {
	return 'Whatever Title you want to use here';
}
add_filter('login_headertitle', 'prefix_wp_login_title');