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.

Got the Internet Marketing Newsletter?

  • My analysis of the industry
  • The latest trends and opportunities
  • Tips and tricks that I use on my sites
  • It's free!

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

  1. Jay Tillery on September 30th, 2008 8:40 pm

    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. :)
    -Jay

  2. GlamourGaby on September 30th, 2008 9:14 pm

    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?

  3. Desk Coder on September 30th, 2008 9:20 pm

    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!

  4. Ajay D'Souza on October 1st, 2008 1:43 am

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

  5. Adam on October 1st, 2008 3:00 am

    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!

  6. TechZoomIn on October 1st, 2008 4:48 am

    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.

  7. Venkat on October 1st, 2008 5:29 am

    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.??

  8. Daniel Scocco on October 1st, 2008 7:15 am

    @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”

  9. Daniel Scocco on October 1st, 2008 8:58 am

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

  10. BloggerNewbie on October 1st, 2008 10:53 am

    @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!

  11. Sridhar Katakam on October 1st, 2008 1:31 pm

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

  12. Dennis Edell on October 1st, 2008 9:11 pm

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

  13. Sridhar Katakam on October 2nd, 2008 12:41 am

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

    http://www.webtechdaily.com/20.....log-posts/

  14. Patrick on October 2nd, 2008 5:26 am

    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.

  15. hakan yamanoglu on October 2nd, 2008 10:28 am

    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.

  16. Daniel Scocco on October 2nd, 2008 11:33 am

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

  17. Joost de Valk on October 2nd, 2008 1:39 pm

    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.

  18. Lloyd Budd on October 2nd, 2008 3:49 pm

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

  19. Daniel Scocco on October 2nd, 2008 4:39 pm

    @Joost, thanks, trying it now.

  20. hakan yamanoglu on October 2nd, 2008 4:54 pm

    @Daniel

    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 :)

  21. Daniel Scocco on October 3rd, 2008 4:59 pm

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

  22. hakan yamanoglu on October 4th, 2008 5:41 am

    @Daniel

    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

  23. Yawza on October 4th, 2008 3:12 pm

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

Got something to say?





Sponsors

Content rich web directory Online Invoicing For Freelancers Why I recommend Doreo Hosting Put your writing skills to work free images for blogs Premium WordPress Themes

Popular Articles

Recent Articles

ebook: Tools and Techniques to Find the Perfect Domain