Allow .json file upload in WordPress (error: Sorry, you are not allowed to upload this file type.)

By using the snippet bellow, you set your wordpress website to allow .json files to be uploaded in the media section.

    
add_filter('mime_types', 'add_json_mime_type', 10, 1); function add_json_mime_type($mime_types) { $mime_types['json'] = 'application/json'; return $mime_types; }

Leave a Reply