Disable Video Uploads

Product: Admin Framework Pro

The Disable Video Uploads module prevents users from uploading video files to the WordPress media library. By blocking formats like MP4, AVI, and MOV, it helps save server space, improve performance, and encourage external video hosting solutions such as YouTube or Vimeo.

How to use

To enable the Disable Video Uploads Module:

  1. Click on the “Images & Media” category
  2. Search or scroll to locate the Disable Video Uploads Module
  3. Click on the switch to enable

What’s next?

This module will block all video file uploads to your WordPress media library. Here’s what happens when enabled:

1. Blocked Video Formats

The following video file formats are blocked:

  • .asf (Windows Media)
  • .asx (Windows Media)
  • .wmv (Windows Media Video)
  • .wmx (Windows Media Player)
  • .wm (Windows Media)
  • .avi (Audio Video Interleave)
  • .divx (DivX)
  • .flv (Flash Video)
  • .mov (QuickTime)
  • .qt (QuickTime)
  • .mpeg (MPEG)
  • .mpg (MPEG)
  • .mpe (MPEG)
  • .mp4 (MPEG-4)
  • .m4v (iTunes Video)
  • .ogv (Ogg Video)
  • .webm (WebM)
  • .mkv (Matroska)

2. What Happens When Enabled

  • Users will not see video files in the media library uploader
  • Attempting to upload a video file will result in an error message
  • Existing video files in the media library will remain but cannot be replaced

3. Customization

You can customize which video formats are blocked using the following filter:

add_filter('WPMazic/disable-video-uploads/blocked_video_mimes', function($video_mimes) {
    // To allow specific formats, remove them from the array
    unset($video_mimes['mp4|m4v']); // Allow MP4 uploads
    
    // To add additional formats
    $video_mimes['3gp'] = 'video/3gpp'; // Block 3GP files
    
    return $video_mimes;
});

4. Re-enabling Video Uploads

To allow video uploads again:

  1. Go back to the Disable Video Uploads Module
  2. Click the switch to disable the module

Important Notes:

  • This module affects all users, including administrators
  • The restriction applies to all methods of uploading files (Media Library, Featured Images, etc.)
  • Some plugins that handle video uploads might bypass this restriction
  • Consider using a content delivery network (CDN) for video hosting if you need to share videos

This module is ideal for:

  • Websites with limited server storage
  • Sites that use external video hosting (like YouTube or Vimeo)
  • Improving site performance by preventing large file uploads
  • Maintaining consistent content strategy (text/images only)

Troubleshooting:

If you notice any issues:

  1. Clear your browser cache if you still see video options
  2. Check if any plugins are bypassing the media upload restrictions
  3. Verify the file extension is correctly mapped to its MIME type