Skip to main content

Disable image upload

What’s the best way to disable image uploads? I know you can hide the image upload button with CSS, but you can still upload images by dragging and dropping them into the post.

Thomas Oates

There is a filter named fluent_community/support_attachment_types that looks like it allows you to modify the list of image types allowed. It defaults to allow the following: jpeg, pjpeg, png, gif, webp.

This seems to work to block all image uploads even when dragging..

//test blocking image uploads
add_filter('fluent_community/support_attachment_types', function() {
    return array();
}, 10);

Marek

Thomas Oates Thanks! I think it would be great if we had such an option in the settings to avoid using PHP or CSS.

Thomas Oates

Marek It would be nice but I doubt that is something they would do given the likelihood that most people won't need it.

Marek

Thomas Oates So I tested this code and the problem is that it also disabled profile image and profile header upload. I just want to keep people from adding images to their posts. Any solutions?

Marek, set 0 on Max Media Per Post from Settings > Customization. This is the only solution now. This way, it won't affect the profile or any other area's image upload.