Skip to main content
Agency Program Hosting from 10% off. A dedicated account manager. Priority support. Built for growing agencies. Hosting from 10% off, a dedicated account manager and priority support for growing agencies. Speak to the team Join free
Custom Upload Dir icon

Custom Upload Dir

v3.6.1
by ulfben · 4.4 (25 reviews)

Keeps your uploaded files organized in smart folder structures.

5K+ active installs Updated Nov 25, 2026 Tested to 7.2 Requires PHP 7.4
Try Demo Download
Pre-installed Ready in ~10s No card

About Custom Upload Dir

Custom Upload Dir is a plugin for WordPress that allows you to customize the folder structure for your uploaded files. It offers more flexibility than the default WordPress uploads folder, allowing you to organize files based on variables like post title, category, and author. This can make it easier to find and manage files, especially when performing backups or migrating your site.

Screenshots

Custom Upload Dir screenshot
Custom Upload Dir screenshot

Changelog

3.6.1 (2026-11-25)

  • Prevent direct access to the main PHP file outside WordPress.

3.6.0 (2026-10-13)

  • Added separate upload templates for Posts, Pages and custom post types. Each can use the default template, its own template, or WordPress’s normal folders (thanks kristinachilds and pedjas for requesting this!).
  • Added a separate template for uploads made directly through the Media Library (thanks somtam for the feedback on Media Library uploads!).
  • Added %author_id% and %current_user_id% for folders named after the post author’s or uploader’s numeric ID (thanks kryvulena for the request and aldemarcalazans for sharing an early solution!).
  • Added %upload_year%, %upload_month% and %upload_day% for folders based on the upload date in your site’s timezone. Existing date tokens continue to use the post date (thanks jslanglois and aslynn for highlighting the confusion between these dates!).
  • Added path previews and clickable placeholders for the new templates.
  • Updated French, German and Swedish translations and settings help.

Upgrading alone preserves existing destinations. No media is moved.

3.5.0 (2026-10-12)

Features and improvements

  • A clearer settings page with clickable, keyboard-accessible placeholders and simpler explanations.
  • Better path previews, including uploads without a post and feedback when a preview post cannot be found.
  • Developers can now add custom placeholders using cud_path_tokens, fixing the old approach that removed them before they could be replaced. The FAQ includes working examples (thanks jeffpannone and tomeagles!).

Bug fixes

  • Fixed cases where block-editor uploads used the wrong post’s details or lost the post information needed for the folder name.
  • Fixed failed uploads affecting the folder chosen for a later upload.
  • Fixed folder calculations that could accidentally remove part of the site’s upload base path.
  • Fixed settings saves that could discard values. Invalid templates now show an error and keep the previous settings.
  • Fixed the documented %mime_type% placeholder and restored support for older placeholder names.
  • Fixed PHP notices when saved settings are missing taxonomy options (thanks aljuk!).
  • Improved handling of missing authors and deleted categories.

Maintenance

  • Cleaned up older PHP code and made settings-page output safer.
  • Updated the French translation and added German and Swedish translations for the settings page and messages.
  • Reworked the help and examples to make choosing a folder structure easier.
  • Minimum requirements are now WordPress 5.7 and PHP 7.4.

When upgrading: your saved template and existing files are kept. Dated folders now come only from your template: include /%year%/%monthnum%/ if you want them. Saving plugin settings no longer changes WordPress’s separate Media settings.

3.4.6 (2020-07-17)

  • Fixed a null dereference error.

Changelog v. 3.4.5 (2020-05-05)

  1. added french translation (thanks, bibi699depreau!)

Changelog v. 3.4.4 (2019-03-24)

  1. Fixed a few PHP warnings
  2. Removed the %permalink% template as it broke uploads to drafts.

Changelog v. 3.4.3.2 (2019-03-24)

  1. Fixed ‘upload_dir’ not providing $post_id in Gutenberg editor.

Changelog v. 3.4.1 (2015-03-16)

  1. Added filter ‘cud_generate_path’ so you can easily adjust the path with any variable you want.
  2. Added %mime_type% to sort files by mime type
  3. Added %author_role% to sort files by author role.
  4. Coming: support for per-post-type settings. Eg: every post type can have their own rules for where to place uploads. Currently missing the admin interface. If you feel like helping out, let me know.

Changelog v. 3.4 (2013-02-09)

  1. Added %file_ext% to sort by file type
  2. Added tentative support for uploads from WordPress apps.
  3. Removed setting for “Base upload folder” as WP core no longer exposes this
  4. Cleared out some PHP error on the admin page
  5. Fixed leaking CSS on admin page

Changelog v. 3.3.2 (2011-12-29)

  1. Updated init to use WordPress API properly
  2. Removed dead code

Changelog v. 3.3.1 (2011-12-27)

  1. Fixed poor sanitization of post slugs (%post_name%)
  2. Added %post_parent%
  3. Fixed settings not always initializing

Changelog v. 3.3 (2011-12-18)

  1. Support for WordPress 3.3
  2. Support for tags and categories
  3. Support for custom taxonomies
  4. Added %current_user%, %permalink%
  5. Added all permalink tags
  6. Added test-function to admin page

Changelog v. 3.0.2 (2011-07-29)

  1. Fix for post_author not working
  2. Fix timestamps from the media uploader (thanks; alx359)

Changelog v. 3.0.1 (2010-11-01)

  1. Fix for “undefined function get_userdata()” (thanks somatic!)

Changelog v. 3.0 (2010-10-21)

  1. Rewrote entire plugin for WordPress 3.0
  2. A slew of new placeholders for building path’s with
  3. A new interface to allow arbitrary strings in path
  4. Error messages when uploading to un-named or un-dated posts
  5. Added translation support

Changelog v.2.5.4 (2008-12-31)

  1. Adjusted the test case. (Pedja)

Changelog v.2.5.3 (2008-12-30)

More problems have crept up due to the massive amount of dry runs of ‘upload_dir’ in WP 2.7.

  1. Added quick bail for every call that’s not for a file upload. (props to Pedja Ljubomirovic (Canada))

Changelog v.2.5.2 (2008-12-15)

  1. Fixed problem with plugin blocking deletion/editing of attached files.

Changes in v.2.5.1 (2008-12-14)

  1. Fixed Custom Upload Dir breaking WP 2.7 when called from the loop

Changes in v.2.5 (2008-11-15)

  1. Support for WP 2.7-beta1
  2. Added ‘post_author’
  3. Fixed ‘post_title’ (broken since WP 2.4)
  4. Fixed issue with use_yearmonth overriding post date
  5. Tons of small(ish) updates
  6. Removed Mediacaster-support

Changes in v.2.0 (2007-10-19)

  1. Mediacaster compability.
  2. Added proper configuration screen
  3. Massive code overhaul
  4. Name change (previously “Daily Upload Dir”)

Try other plugins

Classic Editor icon

Classic Editor

4.9 · 8M+ installs

Enables the previous "classic" editor and the old-style Edit Post screen with TinyMCE, Meta Boxes, etc. Supports all…