Title: Remove HTTP:// From Links
Last modified: August 18, 2016

---

# Remove HTTP:// From Links

 *  [Shelby DeNike](https://wordpress.org/support/users/sdenike/)
 * (@sdenike)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/remove-http-from-links/)
 * I am using WordPress as a homepage for an internal server. On the links I have
   it pointing to certain folders inside my Lan such as mrtg/ = should load the 
   mrtg folder. But when adding links in the admin section under links in the URI
   section it always adds http:// to the link. Where can I remove that at?

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

 *  [petit](https://wordpress.org/support/users/petit/)
 * (@petit)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-321659)
 * Not quite clear about this.
 * WordPress cannot just *point* to folders on your Lan. Even on a local network
   it has to work on a web server. That is to say, it must be installed somewhere
   under the document root of a web server and must communicate over the http protocol,
   normally on TCP/IP network.
 * So how do you “point to certain folders” ?
 *  Thread Starter [Shelby DeNike](https://wordpress.org/support/users/sdenike/)
 * (@sdenike)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-321665)
 * I have WordPress setup and running on Apache 2.0 … What I am asking is where 
   in the code would I be able to comment out the “[http://&#8221](http://&#8221);
   that is being added to links that I create in the “Add Link” section. What I 
   am wanting to do is make so that the links are like so < a href=”mrtg/”>link</
   a> instead of it making them like so < a href=”[http://mrtg/”>link](http://mrtg/”>link)
   < /a>
 *  [petit](https://wordpress.org/support/users/petit/)
 * (@petit)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-321864)
 * OK! If I finally understand you right, you want relative URL:s ?
 * Both URL:s still confuse me.
 * The `< a href="mrtg/">` will not work because it lacks the protocol part.
 * 1. As you are indeed using a web server, the address must contain a domain name.
   Like so:
    [http://mycomputer.mydomain/mrtg/](http://mycomputer.mydomain/mrtg/)(
   normal alias for mycomputer is www, but its OK with the computer name known to
   the local network too )
 * 2. If both your client ( browser ) and the web server is on the same machine,
   you can use [http://localhost/mrtg](http://localhost/mrtg) in your browsers address
   field. In calling the web from another machine you must use the machine name 
   or an alias.
 * 3. If you use relative URL:s for your links, the browser will add the protocol
   and computer-domain part
    [http://mycomputer.mydomain/](http://mycomputer.mydomain/)
   so why do you prefer relative URL:s?
 *  [brett7481](https://wordpress.org/support/users/brett7481/)
 * (@brett7481)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322122)
 * I am trying to figure out how to remove the http:// in front of links added through
   the admin panel also. Where in the code is this added?
 * WordPress itself automatically adds an http:// at somepoint in the code to your
   links, if you do not add it yourself. I’ve tried finding it, but thus far can
   not. Anyone have a clue where it is?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322123)
 * brett,
    why would you do that?
 *  [shanepike](https://wordpress.org/support/users/shanepike/)
 * (@shanepike)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322124)
 * He wants to do that because he wants the links to be relative (e.g. “/somepage”)
   rather than explicit (“[http://www.mydomain.com/somepage&#8221](http://www.mydomain.com/somepage&#8221);).
   There are many good reasons someone would want to do this. I’ve also been trying
   to strip that forced “[http://&#8221](http://&#8221); so I’ll post here again
   if I figure it out.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322125)
 * Relative or absolute, a web url still always starts with “[http://&#8221](http://&#8221);.
   If it isn’t prefixed as such, most browsers will assume it for you.
 * Even a local lan share has a server name.
 * Is the OP trying to browse to local network file shares? (\\servername\sharename)?
 *  [shanepike](https://wordpress.org/support/users/shanepike/)
 * (@shanepike)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322127)
 * A relative URL lets the client figure out the full path. That’s why you use relative
   URLs. Who wants to type the whole URL every time? Adding the “[http://&#8221](http://&#8221);
   by default assumes that everyone’s always going to be entering an offsite URL,
   which isn’t the case.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322128)
 * Not necessarily…. on my local server, the urls still begin with “[http://&#8221](http://&#8221);–
   [http://localhost/](http://localhost/) etc.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322129)
 * Agreed, relative vs. absolute is more about the path than it is the server. leading“/”
   to indidate top of the “web root” (absolute), where as a directory without the
   leading slash indicates it is a sub directory of your current page (i.e. relative).
 * Http:// remains the web protocol, regardless of which is used.
 *  [knitter](https://wordpress.org/support/users/knitter/)
 * (@knitter)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322165)
 * Has anyone figured out how to do this? I use Links to point to various parts 
   of my own site using relative links (with absolute paths). It is of great importance
   to me for future compatibility that they NOT contain the “[http://domainname&#8221](http://domainname&#8221);.
   Internal links should be relative so you can just pick the whole thing up and
   dump it in a new domain and everything will still work. If I decide to change
   my domain name one day I DO NOT want to have to edit every internal link in the
   content to change the domain name, what a headache! All of my external links 
   are obviously absolute urls.
 * This was working in previous verions of WP btw, and has only become a problem
   for me since upgrading.
 * I should add that the inability to add relative internal links is not only a 
   potential problem if I change my domain name in the future. It will be a problem
   every time I want to run a copy of my blog on “[http://dev.mydomain.com/&#8221](http://dev.mydomain.com/&#8221);
   while upgrading, redesigning, etc and want to test adequately.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322166)
 * In rereading my comments above, I’d suggest that I was a wee bit off track on
   my insistence of providing “[http://&#8221](http://&#8221); in the link. In fact,
   I should be beaten about the head and shoulders — I use relative urls ALL the
   time in my blog and should definitely have known better.
 * Things like
    `<a href="/blog/2005/11/10/music-projects/">other article</a>` seem
   to be safe and portable.
 * I apologize to all previous folks in this thread for my misleading statements.
 *  [knitter](https://wordpress.org/support/users/knitter/)
 * (@knitter)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322167)
 * I have commented out line 483 of admin-functions.php and solved my problem.
 * “$_POST[‘link_url’] = preg_match(‘/^(https?|ftps?|mailto|news|gopher):/is’, $
   _POST[‘link_url’]) ? $_POST[‘link_url’] : ‘[http://&#8217](http://&#8217); . 
   $_POST[‘link_url’];”
 * I hope this is helpful to anyone else wanting to add relative links. I haven’t
   tested it terribly extensively so be careful. This will also mean it is entirely
   up to you to make sure you include the http:// (or whatever) in your links if
   it is actually needed.

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

The topic ‘Remove HTTP:// From Links’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 8 participants
 * Last reply from: [knitter](https://wordpress.org/support/users/knitter/)
 * Last activity: [20 years, 1 month ago](https://wordpress.org/support/topic/remove-http-from-links/#post-322167)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
