The Visody plugin allows you to upload GLB and glTF 3D model files by default.
However, if you still encounter an issue in WordPress where it displays an error stating “you are not allowed to upload this file type,” it likely indicates that some settings of WordPress still restrict the upload of these file types.
In this article we will show you some steps you can take to still fix the issue on your site.
In this post:
WordPress default file types
To keep your site secure, WordPress restricts the allowed file types to the most commonly used file types only.
The default allowed file types and extensions are:
Images: .jpg, .jpeg, .png, .gif, .ico, .webp
Documents: .pdf, .doc, .docx, .ppt, .pptx, .pps, .ppsx, .odt, .xls, .xlsx, .PSD
Audio: .mp3, .m4a, .ogg, .wav
Video: .mp4, .m4v, .mov, .wmv, .avi, .mpg, .ogv, .3gp, .3g2
However, some file types can be misused and lead to potential security risks, so WordPress doesn’t enable them by default.
Is it safe to accept 3D model file uploads?
File uploads can lead to hacks, but most well-made plugins protect against this.
You should be careful what types of files you allow to be uploaded since some can be more dangerous.
If you want to upload 3D models, just make sure you only allow the 3D model file types you want to use.
Other safety considerations include:
- Ensure that only logged-in users can upload files
- Restrict file types that can be uploaded
- Consider adding a security plugin to monitor your site
2 methods to upload 3D models in WordPress
1: Install a file type manager plugin
Instead of relying on the default media library, consider using a dedicated plugin that allows you to upload the file types of your 3D model.
Some helpful plugins are:
WP Add Mime Types
Mime Types Plus
WP Extra File Types
File Upload Types
Follow the instructions provided by the chosen plugin to allow 3D GLB and glTF model uploads using the default WordPrss media library.
2: Enable unfiltered uploads in WordPress
Another method you can use is to modify the WordPress configuration file to allow additional file types.
To do this, you will need to edit the wp-config.php
file of your WordPress installation:
- Access your WordPress site’s files using an FTP client or file manager provided by your hosting provider.
- Locate the
wp-config.php
file in the root directory of your WordPress installation. - Open the
wp-config.php
file with a text editor. - Add the following line of code to allow additional file types:
define('ALLOW_UNFILTERED_UPLOADS', true);
- Save the changes and upload the modified
wp-config.php
file back to your server.
Please note that modifying the wp-config.php
file to allow unfiltered uploads can be a security risk, as it bypasses WordPress’s default file type restrictions.
Only use this method if you are confident in the security of your WordPress site and understand the potential risks.
Bottom line
By using one of these approaches, you should be able to overcome the issue of WordPress displaying an error when attempting to upload a 3D model file.
Make sure to only allow the necessary file types and think about including a security plugin to prevent your site from being hacked.