WordPress Built-In Media Library Non Relative Links

I have encountered a problem with the way the built-in media manager inserts media into WordPress blogs.

Normally when I upload and embed / link to photos or other media which are hosted on the same web server I use relative links. For example /images/example.jpg

This has the advantage of when I’m moving between domains the web content would not be affected as long as the example.jpg is in the image directory which is in the root of the website.

WordPress’s way of doing things are by absolute referencing. It inserts the domain + the path of the image like http://www.dannytsang.co.uk/images/example.jpg
This means that if I change my web address from http://www.dannytsang.co.uk to http://www.dannytsang.com the example.jpg would not load because the .co.uk domain would not exist any more (presuming I did not renew or host the site on that domain once I had it on the .com domain).

Of course the media manager would need to add the domain if it was on a different website but there is no option to enable or disable the absolute linking on the built-in WordPress media manager. This has lead me to update a bunch of pages on this site in order for the images and other media to load.

There needs to be an option to switch between the two types of referencing.

About Danny

I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog. Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise. Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school. View all posts by Danny → This entry was posted in WordPress and tagged , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.