WordPress Wizard Needed: How Do We Customize the “Add Media” Editor?


This is a problem that has been bugging me for a while, and I am sure that other people find it annoying as well: when you use the “Add media” feature on WordPress, after uploading the image, the default image size is always set at “Medium,” by default the image comes with an hyperlink to itself, and the default class is a weird code that is not customizable.

wordpress image editor

The result is that when you upload your images images you always need to click on “Large” for the image size, on “None” for the Link field and you can’t define your own CSS class to be used once the image code is placed on the post. It consumes time and it is a bit annoying, especially if you need to upload many images on a single post.

Now there must be a way to change those default parameters and to assign a custom CSS class to the “Add media” editor, right?

My WordPress knowledge is not that advanced, but perhaps some of our readers will know how to do this. If you do, please share with us, I will be glad to give you credit on a further post.

Browse all articles on the WordPress category

24 Responses to “WordPress Wizard Needed: How Do We Customize the “Add Media” Editor?”

  • Yawza

    I cant find the file line either. My line count is 525

  • hakan yamanoglu


    What is your version of wordpress? My media.php file has 1220 lines and i am using 2.6.2

    media.php file size may be different from your’s because of any installed plugin affecting media.php

  • Daniel Scocco

    @Joost, my text editor is showing a diff line count, but I will try to locate the attributes you mentioned.

  • hakan yamanoglu


    We can go easy way 🙂

    I modified media.php file. So, no more medium size and auto complete url for uploaded images from this.

    Overwrite my modified media.php into default file. Download file to here and copy your wp-admin/includes folder.

    That’s all 🙂

  • Daniel Scocco

    @Joost, thanks, trying it now.

  • Lloyd Budd

    This is being worked on so it remembers the choices you made the time before.

  • Joost de Valk

    If you’re running WP 2.6.2, you can change line 538 of wp-admin/includes/media.php to remove checked=’checked’, and move it for instance to line 540, to set image size to full by default.

    Also, on line 620, remove ” . attribute_escape($file) . ” and link URL won’t be filled by default anymore.

  • Daniel Scocco

    @Hakan, any chance you can translate that for us 🙂 ?

  • hakan yamanoglu

    Hi Daniel

    I found a solution for that problem and modified some functions in WordPress. I did writed a article for that problem.

    Thanx for touch on that important point.

  • Patrick

    Thank you very much for the Live Writer reference. First I have heard of it and it is excellent, using it now to redo all my posts to look better.

    Really got something out of this conversation.

  • Sridhar Katakam

    To further augment my earlier comment, I wrote a blog entry:

  • Dennis Edell

    I’m very glad this came up, thanks for the tips!

  • Sridhar Katakam

    I am surprised to see you all use the in-built WordPress editor. Have you given Windows Live Writer a try?

  • BloggerNewbie

    @Desk Coder, I would like the div command also…

    that “bug” isn’t as annoying as the bug in “post at a future date” feature. It is driving me crazy. When I request a future date, the post goes off into never never land. no help or even response from wordpress..at least an acknowledgment would be appreciated. that is more than annoying. anyway, I am hoping for a fix in the next update. for now I will just let my blog dictate my time!

  • Daniel Scocco

    @GlamourGaby, any chance one would be able to do those tweaks on the WP code directly without needing a plugin?

  • Daniel Scocco

    @GlamourGaby, Image and no URL would rock 🙂 .

    @Desk Coder, I guess we lost your code on the comment formatting. You need to use those weird characters in code.

    @Ajay, I will try that thanks.

    @Venkat, I believe you can change that under “Settings,” and then “Miscellaneous”

  • Venkat

    Another point is the the automatic thumbnail creation along with the default images which also take up server space.Is there a way to stop the thumbnail creation.??

  • TechZoomIn

    It bugs for me too…..

    While googling for this longback,found a plugin to customize the add media.. didn’t bookmarked the site.. i will check once again and let you know daniel.

  • Adam

    Aye Daniel, this new media editor needs an upgrade or plugin desperately. I just figured out how to change the 500 pixel limit wordpress puts in on the full size, which is nice but fill size should mean full size! Argh!

  • Ajay D’Souza

    I use IImage Browser plugin to add/organize my images. It is a rather ancient plugin but does the job fabulously 🙂

  • Desk Coder

    Actually, the only thing I don’t mess with on that pop-up is the alignment. I prefer to wrap the image in a div tag, and float it left or right:

    (Not sure if that will work.)

    I do this because in feed readers, it keeps the image in the same position as in the post. Feed Readers can’t read your CSS!

  • GlamourGaby

    I can only give you a plugin I have made just now that will make the default size to “full size”.

    I haven’t figured how to make the url not show yet.
    I mean I did but the other two buttons won’t work anymore. So you can’t link to the image anymore. You have to do that manually.

    So what version do you want? The “image size” or the “image and no url” version?

  • Jay Tillery

    Yes! It also bugs the heck out of me.

    There is a media.php file within your wordpress build located at wp-admin/includes. I wouldn’t change any of the core files within wordpress, but you can start by looking at the function image_attachment_fields_to_edit. If you have any questions IM me i’ll help you along. It’s much easier than a comment field. 🙂

Comments are closed.