WP Manifestindependent plugin directory
manifest / media / moo-digital-custom-mime-types

Moo Digital Custom MIME Types

A lightweight WordPress plugin that enables uploading of custom file types (EPUB, SVG, etc.) to the WordPress media library with built-in security features.

by Moo Digital · github.com/moo-digital/moo-digital-custom-mime-types · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/moo-digital/moo-digital-custom-mime-types/archive/refs/heads/main.zip

Readme

Moo Digital Custom MIME Types

A lightweight WordPress plugin that enables uploading of custom file types (EPUB, SVG, etc.) to the WordPress media library with built-in security features.

Features

  • Custom MIME Type Support: Enable additional file types in WordPress media uploads
  • SVG Sanitisation: Automatic XSS protection for SVG files
  • Simple Configuration: Easy-to-edit configuration array
  • Moo Digital Integration: Integrates with the shared Moo Digital admin menu
  • Security First: Built with WordPress security best practices

Default Enabled MIME Types

  • EPUB (.epub) - application/epub+zip
  • SVG (.svg) - image/svg+xml (with XSS sanitisation)

Installation

  1. Download the plugin files
  2. Upload the moo-digital-custom-mime-types folder to /wp-content/plugins/
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Access settings via Moo Digital > Custom MIME Types in the WordPress admin

Configuration

Adding or Removing MIME Types

To modify which file types are supported:

  1. Open moo-digital-custom-mime-types.php
  2. Locate the MOO_CUSTOM_MIMES configuration array (around line 24)
  3. Add or remove entries as needed:
define('MOO_CUSTOM_MIMES', [
    'epub' => 'application/epub+zip',
    'svg'  => 'image/svg+xml',
    // Add more MIME types here:
    // 'webp' => 'image/webp',
    // 'woff2' => 'font/woff2',
]);
  1. Save the file

Common MIME Types

Here are some additional MIME types you might want to add:

'webp' => 'image/webp',           // WebP images
'woff' => 'font/woff',             // Web Open Font Format
'woff2' => 'font/woff2',           // Web Open Font Format 2
'ttf' => 'font/ttf',               // TrueType Font
'otf' => 'font/otf',               // OpenType Font
'json' => 'application/json',      // JSON files
'webm' => 'video/webm',            // WebM video
'ogg' => 'audio/ogg',              // OGG audio

Security

SVG Sanitisation

When SVG uploads are enabled, the plugin automatically sanitises uploaded files by removing:

  • `

Read the full README on GitHub →