Site logo

Archived topic

Error message

1 reply · Started by Hans on October 9, 2022

Viewing posts 1–2 of 2

I use this routine recommended by you:

add_filter( 'upload_mimes', function( $mimes ) {
    $mimes['woff']  = 'application/x-font-woff';
    $mimes['woff2'] = 'application/x-font-woff2';
    $mimes['ttf']   = 'application/x-font-ttf';
    $mimes['svg']   = 'image/svg+xml';
    $mimes['eot']   = 'application/vnd.ms-fontobject';

    return $mimes;
} );

All files can be loaded except ttf. I get an error message that the upload is forbidden! What might be the reason?

Hi Hans,

Try accessing your wp-config.php file through FTP then add define('ALLOW_UNFILTERED_UPLOADS', true); inside the file. Then, add the ttf file, and remove the code in wp-config afterwards.

This archived topic is closed to new replies.