Sometimes you just want to upload a file to a post/page/category/taxonomy/etc.. This plugin allows you to do that with no popups, no additional page loads, no extra work‚ just a simple upload button on you post/page editor. Works with custom post types as well! You can have as many uploaders per page as you like. It even creates shortcakes and widgets for your use so no coding required! (code snippets also available if needed for a more custom integration).
I originally wrote this for a client as a way to get company logos to appear inside WordPress posts… easy you say huh? What about if we were dealing with people who had no idea what to do when looking at the standard WordPress ‘Add Media’ or ‘Add Image’ page. It all seemed a bit too complicated for the average person so SB Uploader was born.
The idea of the plugin is that it means the act of uploading an image can be done on the same page as the Post/Page editor and there is no separate upload button, just the Save/Publish Post/Page button as normal. This ensures that as part of their blog post or copywriting process an image could be chosen before publishing.
I have added the ability to also upload images to a category/tag/taxonomy so you can have images showing related to a particular taxonomy. The plugin now allows you to have multiple instances of an uploader meaning that each page can have as many images attached as you like. It also creates shortcodes for each image and allows access via custom widgets as well. I’m pretty sure that’s all bases covered for now.. Do let me know if you want to see this plugin extended in ANY way.
How does it work (Posts/Pages)?
Well the plugin uses JQuery to add the ‘enctype’ argument to the form on the editor page meaning no code WordPress code manipulation is necessary. A box is added to the top right hand corner of the edit page interface with a simple file selector with browse button. When the user hits Publish/Save the file is uploaded and the URL put into a post/page custom field called company_logo. This can then be used by your theme using the following code:
if ($image = get_post_meta(get_the_ID(), ‘post_image’, true)) {
$image = ‘<img src=”‘ . $image . ‘” alt=”Image” />’;
}
echo $image;
How does it work (Tags/Categories/Taxonomies)?
As above with the jQuery but the file upload boxes are added to the taxonomy edit pages instead. Just click browse, choose an image and save the taxonomy/tag/category and you’re done.
I would normally wrap the image variable in a div tag with a class or give the image itself a class so that I can restrict the size or float the image (or both?) using the stylesheet. It simply means that you can include that image inside a template if it exists.
So far I have used it on several sites and not one person had managed to break it or struggled using it. That isn’t a challenge though!
As a little bonus for those that know what they are doing I have written a very basic file explorer to allow you to look around the file system of the site in question and upload/download files as appropriate.
Screenshots
Download: SB Uploader (12.51 kB)
Enjoy! Feedback always welcome…


First off, I’ve been looking for a plugin like this for quite some time! I can’t wait to try it out.
One of my sites allows visitors to upload files, but it won’t allow anyone to access the back end…all the posting comes from the frontend by way of a plugin which has its own editor.
Is there a way to widgetize this so I can put it in the sidebar?
Hi, an interesting idea. The system is written to be based around the admin area but would in theory be used on the front end. It would need to be seriously hardened though as it means that anyone can upload any file to your site including any exploits etc.. I shall add it to the jobs list but it won’t appear right away.
Thanks and please do let me know if you think of anything that you think would make the plugin better.
thanks
Sean
Oops, one more question…can it take more than images? Like…pdf, xls, doc files?
Yep, it can be used for any file type.
thanks
Sean
Thanks for the prompt response. On the frontend site that I spoke of, I don’t worry about security as it’s behind several levels of secured access. I can see where it would otherwise be a challenge to convert to the frontend.
I’m going to see if I can somehow widgetize this, but if you have a quicker hack (heh) I’d like to know what it is.
I just installed it, will let you know how it works!
Hi, good luck with widgetising it. I shall take a peek if i get a sec but no promises sadly. If you do manage to do it though then please do send on the updates and I shall integrate it into the code and check it in so that a) others can benefit and b) you get your custom changes in with my future updates. I see that it would be an interesting use of the plugin except it would have to always be one of those use at own risk kind of things. I am happy to work with you though if you need any advice etc.. use my email.. barton.sean@gmail.com
Thanks, hope you like the plugin!
Sean
This is a great plugin!
The uploader meta box shows up in posts and pages but doesn’t show up in any of my custom post types. Do you know what the problem could be?
Hi Friend,
Thanks for your feedback. Really glad that people are using it. I trust you have seen the new settings page I added recently? I just checked in a new version of the plugin a few minutes ago which does support all post types. Before long I shall be adding support for optional numbers of uploaders for each post type but for now the number you select on the settings page is spread across the board.
Hope this is ok.. let me know if you have any issues.
thanks
Sean
Very nice Sean. This is the kind of easy stuff clients would like to use since it is far more simplistic than the add image icon and its magnitude of options.
I have a few proposals to make the plugin even more powerful, or maybe there is something out there and you can point me in the right direction. Ideally I’d like to see it be used in multiple instances in the same edit page so that I can insert it into loop.php. This allows for more simplicity for the client. For example:
Image 1 Browse
Image 2 Browse
Image 3 Browse
Second: with a upload button or the page doing it automagically after selecting a image file, a GUI crop and resize would be amazing.
Haha. Those are just my thoughts. Keep up the great work!
Ha. Well, isn’t my face red…and you’re even more brilliant than I thought. After viewing a few pages of your website. It seems I must have missed the option to make multiple instances.
Hi Mike,
Thanks for the comments and the feedback. I added the functionality you suggested literally a week ago and really if there is one Fault with WordPress it’s that you can’t easily tell what’s changed from version to version. It would be nice if when upgrading a plugin you see the latest changelog entry or something. Oh well… my documentation for it isn’t wonderful but then I like to think it’s self documenting. I intend to add some more granularity to the box for custom post types as at the moment it shows the set number of upload boxes for all post types. Category images is a handy addition of mine though
Thanks again and by all means let me know if you have any more ideas for this or any more of my plugins.
cheers
S
Hi this looks lik eit’s exactly what I have been looking for.
But I have a question. The example code you posted in your explanation: if ($image = get_post_meta(get_the_ID(), ‘post_image’, true)) {
$image = ‘’;
}
echo $image;
do I just paste it as is or do I have to make modification to it?
Example I set it up on my site and it created a custom field name of custom_image_1 how do I call that in a loop?
I tried a few variations of your example code but no luck yet.
Oh and if it isn’t painfully obvious, I’m not a coder
What I’m trying to do is use your plugin and use it for all post images in the loop(s).
example in a loop I now use:
The thumb_size is a pre dtermined size. There are 4 more size for different area’s in my theme, excerpt, single page, blog & post thumb. When I use the default media uploader they get resized automatically. But I don’t want to use the default uploader because it confuses users who are not familiar with WP.
So far I’m only able to get full size images. with the sb uploader.
Hi Troepi.
Sorry I thought I replied to this. I can help you integrate it if you want to email be at barton.sean[at]gmail.com. My plugin doesn’t resize images but I can add that functionality perhaps… Or I can show you how to constrain the size of images using CSS.
thanks
Sean
Great Plugin thanks for sharing it…
Indeed this is a very good idea! The default media uploader has some of my clients really confused.
A GUI crop right on the post/page would be excellent I think.
Hi wholmes,
Thanks for the feedback. Glad you like it. Not sure what you mean by GUI crop but if you explain a little I can perhaps put something together for you. Pardon my ignorance here
thanks
Sean
I missed the reply it was some time ago. I was referring to the ability to crop image manually. maybe a mashup of wp post thumbnail which is very dated. You’ve still got probably the best solution for clients by the way.
Hi there… I must admit I lose track of these things sometimes. Uploading and resizing images is something which I intend to branch out into. I prefer not to use other peoples’ work but can at least take a look at their approach I suppose. I goes actually resize images would you believe if you uncomment the line in the upload method however I have yet to add a settings page for it so it has remained turned off for a few versions.
I shall take a look for the next versions as upload/crop is something which would benefit my day job as well!
thanks
Sean
Hi Sean,
I came here looking for screenshots but I can’t find any. Where are they?
Thanks,
Anna
Hi Anna, sorry I realise I need to add some screenshots to that page. Have a look at this page for more information and pictures….
http://www.sean-barton.co.uk/2011/06/sb-uploader-gets-an-upgrade/
thanks
Sean
Hi again Sean, was wondering how to remove metaboxes for a particular custom post type. I thought updating with 0 would do it but it’s not working I am able to remove all but one metabox (if there are multiple).
Thanks
Hi again, setting it to 0 should do the trick… are you using the latest version? It’s something I added a version or two ago. Does it work with any post type or is it just certain types which still show?
ta
S
I’m using 2.6 and IT’s only the custom post types that are not “zeroing out” so to speak. It always leaves one box.
Info… I’m running wp 3.2.1 multisite, local Xampp install. The plugin is not network activated. It’s a normal activation on one of the sites.
Thanks again for looking into it.
I stand corrected. the image is being removed but the metabox with the image is still there.
Hi there, took a few days for me to get around to this but found you were correct and have made a change or two to the code and hopefully will fix it for you. Try version 2.8 from the WordPress repository and let me know how you get on.
thanks
Sean
Hi Again,
I’ve tried the latest version and it seems that the first metabox I add to custom post types isn’t working for me. The second and subsequent uploaders are working but not the first. I hesitate to post while I tried to find conflicts but I get the same behavior over many tests.
@wholmes: Hi… sorry for not getting to this sooner but I have sorted an issue on the settings page which might have been causing this. If you get a missing meta box then try adding another meta box and then removing it again using the settings page. I just checked in version 3 which might improve things somewhat for you. Check it out and let me know if it resolves your issue or not.
thanks
Sean
Hi Sean,
Can you please tell to a noob like me how to use your wonderful plugin in order to display the taxonomy images in single post pages? Instead of the tags ID’s, I would like to get the related images. Or both…
I can do some basic alterations to my theme components, but don’t know where to start from.
Thank you in advance and please excuse my weird english
Hi MeSSeR,
No problem at all. You should just be able to use the following code in your single.php file as is to do the job:
< ?php sbu_get_the_category_image('image_name'); ?>
Where image_name is what you called your category image field.
Hope this helps.
thanks
Sean
Hi Sean,
Can you tell me if this plugin works with wp 3.3.1? If it doesn’t, when might you have the plugin updated?
Hi Louis,
Thanks for your comment. The plugin works fine with 3.3.1. I have tested it and not found any bugs. I do test it with all new versions of WordPress and in the event a bug is found I normally can look into it within a few hours of being notified.
Let me know if you need any help with it.
thanks
Sean
Hi Sean,
Your nice plugin ist almost what I’m looking for… but, do you think there’s a way to make the uploaded image become a featured image in the post ?
I hope so…
thank you
Hi Guibo,
Thanks for your comment. It currently doesn’t set the featured image but it’s something that I am considering doing for future versions. Keep an eye on the update checker.
thanks
Sean
Hi Sean,
Thanks for the plugin, it works really great! I found it while looking for a simpler method to upload images to a post. The native image uploader seems to be too complicated for some users…
I was wondering if you are planning to add multi-image-upload to the plugin anytime soon? I have a project where the users can upload up to 12 images but that results in a meta box overkill…
If not do you maybe know a decent alternative? I have been searching the web for weeks but couldn’t find a simple multi-image-uploader so far…
Thanks and regards,
Thomas
Hi Thomas, thanks for your comment. I do actually plan to pad out this section of the system at some point. It’s currently forcing you to choose a fixed number of uploaders to use. I imagine the simplest method of sorting this would actually be to move the meta box for systems that want more than say three to the ‘normal’ or ‘advanced’ position and have multiple uploaders in the same meta box. This means you can have 12 easily with only one new meta box and a couple/few rows of uploaders for your desired number.
How does that sound? I thought of going a dropdown box type route but that isn’t really usable and might just confuse the users even more.
cheers
S
Hey Sean,
Thanks for the reply!
Your idea sounds good, maybe you could even use JavaScript to only show the next upload field if the previous one has a file selected…?!
Right now I’m using a reduced version of the built-in media uploader where I removed some settings and buttons.
Cheers
Thomas
I’m still a bit ‘confused’ as to how to use this plugin. I know what the requirement is and with the word Uploader in the name, I thought I found the right plugin. I activated the plugin and uploaded an image in a page BUT how can I remove it from the page now?
I must have misunderstood what the plugin was designed to do
Hi Twanny,sorry I don’t really follow what you are asking. Can you be more specific about what you are trying to do and I shall help as best I can.
thanks
Sean