How to set Browser Uploader as Default in WordPress

San Francisco WordPress Plugin DevelopersI needed to make the Browser uploader default in a WordPress installation. It had nothing to do with the Flash Uploader malfunctioning, it was just a requirement I had to meet. So essentially, I needed to disable the Flash Uploader in WordPress.

After a quick search of the web on how to make the Browser uploader the default media uploader I cam across a couple plugins. One, that seems like a great plugin, allows you to switch off the WordPress Flash Uploader:

Now this looks like a great plugin and you can read it’s claim at the WordPress Forum post, “How to make browser uploader default“.

There also seems to be an outdated plugin called Disable Flash Uploader which hasn’t been updated since 2009.

Long story short, I found that either these were a bit overkill for my needs or wasn’t even worth trying. What I eventually ended up doing to disable the WordPress Flash Uploader and make the Browser uploader default was to add a simple filter in my functions.php file. Here it is:

/**
 * Set false the Flash Uploader. Use the Browser uploader as default.
 */
function browser_uploader_default() {
        return $flash = false;
}
add_filter( 'flash_uploader', 'browser_uploader_default', 7 );

That’s it. That how I was able to set the WordPress Browser uploader as default, essentially disabling the WordPress Flash Uploader.

Ok, on edit, I noticed a one line method to handle this. It uses PHP’s create_function which I wasn’t aware of at the time. Here’s an old post mentioning an even more compact way of disabling the flash uploader:

add_filter('flash_uploader', create_function('$flash', 'return false;'));

I pulled the code above from a post called, “The World’s Shortest WordPress Plugin“.

Post written by Ed Reckers

Founder and lead web development consultant at Red Bridge Internet : San Francisco WordPress Developers and Consultants.

4 Responses to “How to set Browser Uploader as Default in WordPress”

  1. lolo

    Great!!! It’s just i needed!!!
    You are a genius!!
    Thx!!!

  2. didi

    thanks! works for me.

  3. kalesco

    Thanks a lot, still works in 2014 🙂
    (rather old WP 3.4.2 though)

  4. baby hazel

    Thanks a lot, still works in 2014 🙂

Leave a Reply