WordPress media library organization

Give your media library the categories posts have always had

Media Categories adds a full category system to the media library — colored, sortable, lockable categories with drag-and-drop filing, bulk move, and a sidebar filter — so nothing uploaded ever has to stay lost in one giant unsorted grid.

  • Colored, named categories, created and edited in a modal.
  • Drag and drop attachments into a category, or move many at once.
  • A sidebar filter, with optional multi-category AND/OR matching.
  • A lock keeps a category safe from accidental deletion.
Media Library SidebarMedia Categories
Media Categories
All Media9
System3
Blog2
2 categories, 9 files organizedDrag & drop, bulk move, or toggle per file.
Active
Quick answer

What does Media Categories do?

When the media_categories module is active, TOWP_Media_Categories registers a genuine WordPress taxonomy for attachments and adds a sidebar to the media library listing every category with its own color and live count, alongside a built-in "Uncategorized" term that catches anything not yet filed. An administrator files attachments by dragging them onto a category in the sidebar, through a bulk action for many at once, or with a per-category toggle on the attachment's own edit screen. The sidebar's width and the multi-category AND/OR matching mode both stay configurable, and an administrator can lock a category so nobody deletes it by accident, which keeps the system holding up even once something else on the site, like the Media Visibility module, depends on a category existing.

The "one giant unsorted grid" problem

The media library has never had real categories

Because nothing separates one upload from another, a growing library eventually becomes something only search can navigate.

Posts get categories; media never did

WordPress has organized posts by category since the beginning, but every image, PDF and file ever uploaded lands in the exact same undivided grid, regardless of what it's actually for.

Finding one file means scrolling and searching

Without any real organization, locating a specific file on a library with hundreds or thousands of uploads means relying entirely on the search box or scrolling through everything in date order.

A dedicated WordPress solution

A real taxonomy, built for how media actually gets used

The module brings the media library the same kind of organization posts have always had, with the filing tools to make it practical at any scale.

Categories with color, sorting and locking

Each category gets its own color for quick visual scanning, a custom sort order, and an optional lock against accidental deletion.

Drag, drop, or bulk move

File one attachment by dragging it onto a category, or move many at once with a dedicated bulk action.

A sidebar filter with AND/OR matching

Filter the library down to one category, or several at once, choosing whether a file needs to match all of them or just one.

Verified feature set

A genuine taxonomy, not a lookalike

Every capability below is present in the supplied PHP class, its JS and CSS assets, and the settings registration.

Never truly uncategorized

A built-in fallback category

The module automatically creates an "Uncategorized" term that can't be deleted, so nothing uploaded ever falls into an undefined state.

Uncategorized fallbackCannot be deleted
Accurate counts

A custom counter that includes real media

Since WordPress core's own term counter skips attachments with 'inherit' status, which is most media, this module recounts them directly so the numbers are actually correct.

Custom count callbackinherit status included
Locked categories

Protected from accidental deletion

An administrator can still rename and recolor a locked category, but can't delete it until removing the lock first.

Lock metaDeletion blocked
Default category for new uploads

Auto-assigned on upload

An administrator can set a chosen category as the default, and the module applies it automatically to every newly uploaded file.

add_attachment hookConfigurable default
Configurable sidebar width

Resized to fit the site's admin

The sidebar's width accepts px, em, rem or percentage units, so an administrator can tune it to fit an individual site's admin layout.

4 units800 max
Practical use cases

Where real categories help most

The module supports any library that has outgrown a single undivided grid.

Large, growing media libraries

Keep hundreds or thousands of uploads navigable by category instead of relying entirely on search and pagination.

Multi-author or multi-department sites

Separate media by department, brand, or content type, so each contributor sees what's relevant to their own work.

Sites that pair this with Media Visibility

Lock categories that role-based visibility rules depend on, so nobody can delete them out from under that configuration.

Operational benefits

Organized by default, protected where it counts

The module combines genuine navigability with the safeguards a growing library actually needs.

A library that's actually navigableCategories turn an undivided grid into something a person can filter and scan at a glance.
Filing that fits how the work actually happensDrag-and-drop suits one file at a time; the bulk action suits clearing out a large backlog in one pass.
Categories that can't disappear by accidentA locked category stays protected specifically because something else, like a visibility rule, is depending on it.
Counts that reflect realityThe custom counter fixes a real WordPress core limitation, so category counts always match what's actually filed there.
Performance behaviour

AJAX-driven, loaded only where needed

The verified implementation keeps the media library responsive even as categories and files grow.

Counts calculated with one direct query

A single, efficient database query calculates category counts, rather than iterating attachments one at a time.

AJAX-driven, no full page reloads

Filing, filtering, creating and deleting categories all happen over AJAX, keeping the media library responsive throughout.

Assets load only where they're needed

The sidebar's scripts and styles only load on the media library and attachment edit screens, not across the rest of wp-admin.

Security implementation

Capability checks on every single action

The system verifies every category and filing action before it can run.

01

Capability checks on every action

Creating, editing, deleting and reordering categories all require manage_options; assigning attachments requires upload_files and edit_post on the specific file.

02

A locked category resists deletion at the API level

The same AJAX handler that processes deletion checks the lock itself, not just a UI restriction someone could bypass.

03

Nonce verification on every AJAX request

Every category and assignment action checks a nonce before processing, the same protection WordPress uses throughout its own admin.

04

Safe attachment handling before deletion

Deleting a category always moves its attachments to Uncategorized first, so files are never left in a broken or orphaned state.

Verified compatibility

Built on native WordPress taxonomies and jQuery UI

The supplied code integrates through APIs present in WordPress core; this page makes no compatibility claim beyond the verified implementation.

Taxonomy registration

register_taxonomy() on attachment

Categories exist as a standard, REST-enabled WordPress taxonomy attached to the attachment post type.

register_taxonomyshow_in_rest
Term meta

Color, lock and order stored natively

Color, lock state and sort order are all registered as proper term meta, each with its own REST authorization callback.

register_term_metaauth_callback
Drag-and-drop library

jQuery UI draggable, droppable, sortable

The filing and reordering interactions build on WordPress's own bundled jQuery UI components, the same library core itself relies on.

jquery-ui-draggablejquery-ui-sortable
Solution comparison

TheOneWP versus common alternatives

Compare the verified Media Categories implementation with stock WordPress and a typical dedicated plugin.

CapabilityTheOneWP Media CategoriesOther common solutions
Organizing the media library A real taxonomy with color, lock and custom orderOften absent entirely from stock WordPress
Filing attachments Drag-and-drop plus a dedicated bulk actionUsually limited to editing one attachment at a time
Category counts Corrected to include real attachment statusFrequently inaccurate due to a known core counting gap
Protecting categories other features depend on A lock that blocks deletion at the handler levelRarely offered; a dependent category can be deleted by mistake
Administration One settings screen plus an in-library sidebarRequires a dedicated plugin for equivalent functionality
Recommended workflow

Organize the media library in four steps

Start with a small, clear set of categories rather than trying to cover every case at once.

01

Enable Media Categories

Activate the module from the TheOneWP Content settings tab.

02

Create the first few categories

Add categories with a name and color from the sidebar's Add Category button.

03

File existing media

Drag attachments into categories individually, or select many and use the bulk "Move to" action.

04

Set a default and lock what matters

Choose a default category for new uploads, and lock any category other configuration now depends on.

Best practices

Start small, lock what other features rely on

A focused category list, kept protected where it matters, stays useful far longer than an exhaustive one.

01

Keep the category list focused

A handful of clear categories stays more useful day to day than dozens of overlapping ones.

02

Lock categories tied to other features

If a category feeds into Media Visibility or another rule, lock it so nobody can delete it out from under that configuration.

03

Set a sensible default for new uploads

A default category keeps new files from piling up in Uncategorized while editors get around to filing them.

04

Use the bulk action for a large backlog

Filing hundreds of existing files one at a time isn't necessary; select them and move the whole batch at once.

Common mistakes

Avoid habits that undo the organization

A couple of details are easy to overlook once a library has real categories to lose.

Deleting a category still in use elsewhere

Lock a category that feeds into another feature, like Media Visibility, first, so nobody removes it by accident.

Assuming multi-category filtering defaults to matching everything

The sidebar's AND/OR choice determines whether a file needs every selected category or just one, so it's worth checking which mode is active before relying on the results.

Expecting core's own count to match

Since WordPress's default term counting excludes most attachments, this module's corrected count is the accurate one to trust.

Frequently asked questions

Media Categories FAQ

These answers come directly from the verified class, its assets and the settings registration.

What does Media Categories do?

It adds a full category system to the media library, with colored, sortable, lockable categories, drag-and-drop filing, a bulk move action, and a sidebar filter.

What happens to a file that hasn't been categorized yet?

It stays in a built-in Uncategorized category rather than disappearing or causing an error.

Can I delete a category I created by mistake?

Yes, unless it's been locked. Deleting a category automatically moves its attachments to Uncategorized first.

What does locking a category actually prevent?

It blocks deletion specifically; a locked category can still be renamed or recolored at any time.

Why would category counts in core WordPress be wrong?

WordPress's built-in term counter excludes attachments with an "inherit" post status, which covers most media; this module recounts them directly for an accurate number.

Can a file belong to more than one category?

Yes. Attachments can carry multiple categories, and the sidebar filter can match against several at once.

How does the AND/OR filter option work?

With OR, a file matching any selected category appears; with AND, a file needs to match every selected category to appear.

Can I set which category new uploads go into automatically?

Yes. An administrator can choose a default category, and the module applies it automatically to every new upload.

Can I change the sidebar's width?

Yes. The sidebar width accepts px, em, rem or percentage units, up to a maximum of 800 of the chosen unit.

Who can create, edit or delete categories?

Only an administrator with the manage_options capability; assigning attachments to a category requires upload permission on that specific file.

Stop scrolling through one giant media grid.Give it the categories it's always been missing.

Use Media Categories to organize the library with colored, lockable categories, drag-and-drop filing, and a sidebar filter that actually finds things.