What Happend to WordPress’ Media File URL Option?

Beats me! God only knows why the wp folk decided to hose that option, or maybe it’s a bug. Whatever the case my be, I thought the custom File URL option (found under Settings > Media) was a very handy tool of which I have always made good use, and I want it back real bad. So bad, in fact, I figured out how. Very simply add this to your theme’s functions.php file:

update_option('upload_url_path', '/wordpress/wp-content/uploads');

Obviously, change the path to reflect your needs. Unfortunately, this hard-codes this path from functions.php, so although the field is added back to Settings > Media, and it may look like you can update the path from there, it will not save your changes. But in reality, a developer will only need to change this once or twice.

I find this option handy when developing a site at a temporary domain, knowing it will ultimately be migrated to a live domain. Otherwise, you get a fully-qualified temporary URL embedded in all your media attachments which are going to have to be changed anytime the site is moved to a new domain.
This option has saved me from the headache of having to mess with the wordpress mysql database more than necessary.

I will update this post as soon as I can add some convenience to this temporary solution.

Leave a Comment