Title: remove http://www. and https://www. from user website url info
Last modified: September 1, 2016

---

# remove http://www. and https://www. from user website url info

 *  [Kimberly](https://wordpress.org/support/users/_kimberly_/)
 * (@_kimberly_)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/remove-httpwww-and-httpswww-from-user-website-url-info/)
 * I found this:
 *     ```
       $input = 'www.google.co.uk/';
   
       // in case scheme relative URI is passed, e.g., //www.google.com/
       $input = trim($input, '/');
   
       // If scheme not included, prepend it
       if (!preg_match('#^http(s)?://#', $input)) {
           $input = 'http://' . $input;
       }
   
       $urlParts = parse_url($input);
   
       // remove www
       $domain = preg_replace('/^www\./', '', $urlParts['host']);
   
       echo $domain;
   
       // output: google.co.uk
       ```
   
 * But where and especially how do I place this, so the URL showing on profiles 
   will be shorter. Example:
    [https://www.facebook.com/help/notifications](https://www.facebook.com/help/notifications)
   > [facebook.com/help/notifications](https://www.facebook.com/help/notifications)
   We all know that http:// is back to the 90’s and www is gone in the most browsers,
   so why showing old URL’s, right?
 * Only the showing URL and not the hardcoded URL 🙂

The topic ‘remove http://www. and https://www. from user website url info’ is closed
to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Kimberly](https://wordpress.org/support/users/_kimberly_/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/remove-httpwww-and-httpswww-from-user-website-url-info/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
