WordPress blog url without http

If you want to show your WordPress URL without http, you can do it by a str_replace function in combination with the WordPress get_bloginfo(‘wpurl’) function, as follows:

Add al the protocols that you want to remove in an array, and then str_replace the get_bloginfo(‘wpurl’) function.

<?php
 $protocols = array('http://', 'http://www.', 'www.');
 echo str_replace($protocols, '', get_bloginfo('wpurl'));
 ?>

That’s it!