PHPackages                             joppuyo/unique-media-file-folders - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. joppuyo/unique-media-file-folders

ActiveWordpress-plugin[File &amp; Storage](/categories/file-storage)

joppuyo/unique-media-file-folders
=================================

Change the default WordPress upload folder structure to a randomly generated one

v3.0.1(4y ago)8144PHP

Since Feb 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/CreunaFI/unique-media-file-folders)[ Packagist](https://packagist.org/packages/joppuyo/unique-media-file-folders)[ RSS](/packages/joppuyo-unique-media-file-folders/feed)WikiDiscussions main Synced today

READMEChangelog (6)Dependencies (1)Versions (8)Used By (0)

Unique Media File Folders
=========================

[](#unique-media-file-folders)

[![Build Status](https://camo.githubusercontent.com/641ff972c15876f1ebb776ef647fd29a33bda3361d86893cbcc75bfc226af2f5/68747470733a2f2f7472617669732d63692e636f6d2f437265756e6146492f756e697175652d6d656469612d66696c652d666f6c646572732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/CreunaFI/unique-media-file-folders) [![Packagist](https://camo.githubusercontent.com/42bad8975d6c1efcac5cccf76a48b9fadf4058ab86f0f0dbcb4a673098dcfa91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f707075796f2f756e697175652d6d656469612d66696c652d666f6c646572732e7376673f7374796c653d666c6174)](https://packagist.org/packages/joppuyo/unique-media-file-folders)

Change the default WordPress upload folder structure to a randomly generated one. Each image and its thumbnails will be given an unique folder with a randomly generated name.

Why?
----

[](#why)

Because WordPress default media file paths are not very good. You either get year-month folders which may look funny if you are re-using content and is reminiscent of WordPress' blogging engine roots. The other option is to put all files into one folder which does not scale when you start to have a lot of files.

Too many files in a folder can lead to performance issues on filesystems like EXT4. If all your files are in the same folder, you’ll also run into file name conflicts.

How it works
------------

[](#how-it-works)

Instead of the following file paths:

```
https://example.com/wp-content/uploads/2019/01/photo.jpg
https://example.com/wp-content/uploads/2019/01/photo-150x150.jpg
https://example.com/wp-content/uploads/2019/01/photo-300x168.jpg

https://example.com/wp-content/uploads/2019/01/image.png
https://example.com/wp-content/uploads/2019/01/image-150x150.png
https://example.com/wp-content/uploads/2019/01/image-300x168.png

```

The plugin will generate the following paths:

```
https://example.com/wp-content/uploads/cnk3nae60p6f3e942b4cpvm8q/photo.jpg
https://example.com/wp-content/uploads/cnk3nae60p6f3e942b4cpvm8q/photo-150x150.jpg
https://example.com/wp-content/uploads/cnk3nae60p6f3e942b4cpvm8q/photo-300x168.jpg

https://example.com/wp-content/uploads/2xv5r4tnlrcodofcq3ageksmb/image.png
https://example.com/wp-content/uploads/2xv5r4tnlrcodofcq3ageksmb/image-150x150.png
https://example.com/wp-content/uploads/2xv5r4tnlrcodofcq3ageksmb/image-300x168.png

```

How to install
--------------

[](#how-to-install)

1. Download latest version from the [Releases tab](https://github.com/CreunaFI/unique-media-file-folders/releases)
2. Unzip the plugin into your wp-content/plugins directory
3. Activate **Unique Media File Folders** from your Plugins page

Customizing folder depth
------------------------

[](#customizing-folder-depth)

By default, folder depth is 1 so every file will be given its own folder. Customize folder depth using `umff_folder_depth` filter. For example:

```
add_filter('umff_folder_depth', function() {
    return 4;
});

```

Will yield the following folder structure:

```
https://example.com/wp-content/uploads/c/n/k/3nae60p6f3e942b4cpvm8q/photo.jpg
https://example.com/wp-content/uploads/c/n/k/3nae60p6f3e942b4cpvm8q/photo-150x150.jpg
https://example.com/wp-content/uploads/c/n/k/3nae60p6f3e942b4cpvm8q/photo-300x168.jpg

https://example.com/wp-content/uploads/2/x/v/5r4tnlrcodofcq3ageksmb/image.png
https://example.com/wp-content/uploads/2/x/v/5r4tnlrcodofcq3ageksmb/image-150x150.png
https://example.com/wp-content/uploads/2/x/v/5r4tnlrcodofcq3ageksmb/image-300x168.png

```

How are paths generated
-----------------------

[](#how-are-paths-generated)

For all of your files, first a UUID4 will be generated. It will then be encoded into [Base36](https://en.wikipedia.org/wiki/Base36) which means it will contain characters from a to z and 0 to 9. This is used as the folder name. If folder depth option is greater than 1, first n characters of the UUID are used as subfolders.

Further reading
---------------

[](#further-reading)

[Structuring WordPress’ upload directory to handle lots of files - Ctrl blog](https://www.ctrl.blog/entry/wp-content-uploads)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~240 days

Recently: every ~300 days

Total

6

Last Release

1509d ago

Major Versions

v1.1.2 → v2.0.02019-02-13

v2.0.0 → v3.0.02022-05-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3c4b44161119b358d2b0a29605a3e0ebff3ee26a170cb642b095730e8f9d746?d=identicon)[joppuyo](/maintainers/joppuyo)

---

Top Contributors

[![joppuyo](https://avatars.githubusercontent.com/u/1595438?v=4)](https://github.com/joppuyo "joppuyo (39 commits)")

---

Tags

uuidwordpresswordpress-pluginwp-plugin

### Embed Badge

![Health badge](/badges/joppuyo-unique-media-file-folders/health.svg)

```
[![Health](https://phpackages.com/badges/joppuyo-unique-media-file-folders/health.svg)](https://phpackages.com/packages/joppuyo-unique-media-file-folders)
```

###  Alternatives

[blockstudio/blockstudio

The block framework for WordPress.

542.2k](/packages/blockstudio-blockstudio)[ericnorris/amazon-s3-php

A lightweight and fast S3 client for PHP.

2147.0k](/packages/ericnorris-amazon-s3-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
