WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if there is a way to get the URL address to prepopulate with my web address so I don't have to type it in every time I want to insert an image.


Click on the upload/insert "add media" button --> click "from URL" and instead of having a blank box, I would like it to prepopulate with:


this way the only thing I would have to type in is: nameofimage.jpg

share|improve this question
just wondering... did my answer help? – Dean Taylor Apr 3 '12 at 19:40

You can apply a filter to the output of the media insert url form using the filter named wp_media_insert_url_form:

add_filter('wp_media_insert_url_form', 'ex46632_media_insert_url_form');
function ex46632_media_insert_url_form($html) {
    $html = str_replace('<input id="src" name="src" value=""', '<input id="src" name="src" value="http://mysite.com/images/"', $html);
    return $html;

Something like this could be added to your theme's functions.php file. This is untested code that is just as an example of direction.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.