PressTigers

How to Upload File Type VCF in WordPress

WordPress allows a list of specific file types/extensions to upload in WordPress media. File type .vcf is not from one of the default types supported by WordPress. You have to add some code in your theme’s functions.php file to upload the vcf file from media.

For this, WordPress provides its own filter. You can use it in your theme’s funcitons.php file and then try to upload the file having extension .vcf. It will work for you by adding the following code:

After this, you can also add the extension of such a file which is not included in WordPress default file extensions. For this, you simply have to change the extension from the array vcf to another extension as follows:

User Comments

3 thoughts on “How to Upload File Type VCF in WordPress

    Mulli says:

    The above not working.
    Vcf files are not loaded for security reasons – WP 5.4 .

    Garrett says:

    This post is 5 years old, lots has changed. This works as of Sep 2020…

    /**
    * Enable vCard
    */
    function vcard_upload( $mime_types ){
    $mime_types[‘vcf’] = ‘text/vcard’;
    return $mime_types;
    }
    add_filter(‘upload_mimes’, ‘vcard_upload’ );

      Livia Bigler says:

      Hi, I added this code above within the function.PHP but it doesn’t work. Is this theme related or why do I not get this to work? After implementing the code and saving it, do I have to do anything else? I work with the astra, astra child theme.

Leave a Reply

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

Get in Touch