• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Feast Design Co.

WordPress Themes for Food & Lifestyle Bloggers

  • Themes
  • Feast Plugin
  • Blog
  • Support
  • Tutorials
  • Nav Social Menu

    • Email
    • Facebook
    • Instagram
    • Twitter
menu icon
go to homepage
  • Feast Plugin
  • Support
  • Tutorials
  • Account
    • Facebook
    • Instagram
    • Twitter
  • search icon
    Homepage link
    • Feast Plugin
    • Support
    • Tutorials
    • Account
    • Facebook
    • Instagram
    • Twitter
  • ×

    Home » News & Updates

    Sorry, this file type is not permitted for security reasons.

    Published: Sep 18, 2019 · Modified: Sep 18, 2020 by Skylar · Leave a Comment

    When attempting to upload custom font files (eg. .woff) you may encounter a security error in WordPress:

    "font.woff" has failed to upload. Sorry, this file type is not permitted for security reasons.

    This is set at the host level, but can over over-ridden with WordPress filters.

    Warning

    Custom fonts often aren't developed with CLS in mind, and additional effort may be needed to match the line-height, letter-spacing and font-size with the font being swapped.

    This is highly technical and not something we offer support for.

    Solution

    Temporarily create a code snippet with the following:

    add_filter( 'wp_check_filetype_and_ext', 'wpse_file_and_ext_woff', 10, 4 );
    function wpse_file_and_ext_woff( $types, $file, $filename, $mimes ) {
        if ( false !== strpos( $filename, '.woff' ) ) {
            $types['ext'] = 'woff';
            $types['type'] = 'font/woff';
        }
    
        return $types;
    }
    
    function my_custom_mime_types( $mimes ) { 
    // Add new MIME types here
    $mimes['woff']  = 'font/woff|application/font-woff|application/x-font-woff|application/octet-stream';
    return $mimes;
    }
    add_filter( 'upload_mimes', 'my_custom_mime_types' );

    Source

    • https://wordpress.stackexchange.com/questions/338624/upload-mimes-filter-not-working-need-to-allow-woff-and-woff2
    • https://wordpress.stackexchange.com/questions/323221/allowing-webp-uploads/323226#323226

    More

    • GA4
    • Modern 404
    • Focus
    • Process Shots

    Reader Interactions

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    Primary Sidebar

    Themes

    • Feast Plugin grants access to all 5 themes
    • Not sure where to start? See the getting started guide

    Feast Plugin

    • Feast Plugin
    • Modern Homepage
    • Modern Sidebar
    • Modern Footer
    • Modern Mobile Menu
    • Modern Menu
    • Modern Recipe Index
    • Modern Categories
    • Modern 404
    • Recipe Update Checklist
    • Recipe Post Template

    Resources

    • Image optimization
    • Recipe Guidelines for Foodie Bloggers
    • How to write a recipe post
    • Page headings
    • SEO for Food Bloggers
    • Tutorials
    • Pagespeed Audit
    • Comments
    • Internal links

    more resources →

    Categories

    • Modern Recipe Index
    • Modern Categories
    • Posts per Page
    • How to use categories
    • Category pages need content
    • How to configure the category pages
    • Food blog site structure
    • Food blog page structure

    Classic themes

    The classic themes are only for hobby sites and any food blog interested in monetizing or SEO needs the Feast Plugin.

    • Foodie Pro Classic
    • Brunch Pro Classic
    • Cook'd Pro Classic
    • Cravings Pro Classic
    • Seasoned Pro Classic

    Footer

    ↑ back to top

    Topics

    • Food Blog Design and Appearance
    • Productivity
    • Tech and Plugins
    • Food Blogging and Promotion
    • Minimalist WordPress Themes
    • Simple WordPress Themes
    • Travel blogs
    • Knitting + DIY blogs

    Help

    • Documentation & Tutorials
    • Food Blogging Resources
    • Open A Support Ticket
    • Login
    • Your Account
    • Subscriptions
    • Downloads
    • Discounts and Coupons
    • Compatibility

    Company

    • Subscribe to newsletter
    • Privacy Policy
    • Refund policy
    • Terms & Conditions
    • Principles and Best Practices
    • Affiliates
    • Contact

    Copyright © 2023 · Feast Design Co.

    Results not typical or guaranteed. Our themes and plugins are just a small part of the overall effort involved in running a food blog. Nothing on this website shall constitute legal or financial advice, always consult a local lawyer and accountant. Accessing this website and all transactions herein are under the laws and jurisdiction of Toronto, Ontario, Canada.