Title: changing default user website
Last modified: August 18, 2016

---

# changing default user website

 *  Resolved [ianmoody](https://wordpress.org/support/users/ianmoody/)
 * (@ianmoody)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/changing-default-user-website/)
 * When a user posts a comments their name is used as a link to their website. If
   they haven’t got a website it is automatically http:// so on a comments page 
   I end up with several links to “[http:///&#8221](https://wordpress.org/support/topic/changing-default-user-website/?output_format=md);
   Is there a way to stop http:// being in the user url field by default?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [ifelse](https://wordpress.org/support/users/ifelse/)
 * (@ifelse)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/changing-default-user-website/#post-284865)
 * What you can do is edit the comments.php file so that the link only appears if
   they’ve entered a site.
 * In your comments.php page, you’ll should find some code which is along the lines
   of
    `<a href="<?php comment_author_url(); ?>"><?php comment_author();?></a> `
 * You can wrap this in an if check like thus:
 * `<?php if ('' != get_comment_author_url()) { ?>
    <a href="<?php comment_author_url();?
   >"><?php comment_author();?></a>  <?php } else { comment_author(); } ?>
 * Now, the name will no longer be hyperlinked if they didn’t leave a URL.
 *  Thread Starter [ianmoody](https://wordpress.org/support/users/ianmoody/)
 * (@ianmoody)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/changing-default-user-website/#post-284879)
 * Unfortunately that doesn’t solve the problem. When a user signs up their author
   url is automatically being set to http:// if they don’t input anything into that
   field , so http:// then goes into the data base under that users user_url and
   then for every comment that user makes into the comment’s commont_author_url 
   field. I need stop it from auto inserting [http://](https://wordpress.org/support/topic/changing-default-user-website/?output_format=md),
   which I presume would require editing some of WP’s core files, which I can do
   without removing anything important, but I can’t seem to find the right one.
 *  Thread Starter [ianmoody](https://wordpress.org/support/users/ianmoody/)
 * (@ianmoody)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/changing-default-user-website/#post-284987)
 * Fixed it. Just needed to remove ” ‘[http://&#8217](http://&#8217); .” from “$
   newuser_url = preg_match(‘/^(https?|ftps?|mailto|news|gopher):/is’, $newuser_url)?
   $newuser_url : ‘[http://&#8217](http://&#8217); . $newuser_url;” in profile.php

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘changing default user website’ is closed to new replies.

## Tags

 * [users](https://wordpress.org/support/topic-tag/users/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [ianmoody](https://wordpress.org/support/users/ianmoody/)
 * Last activity: [20 years, 5 months ago](https://wordpress.org/support/topic/changing-default-user-website/#post-284987)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
