Allow to upload XML files in WordPress

For security reasons, WordPress does not allow to upload XML files into the media library, by default. To alleviate this limitation, you have to add the following PHP code to functions.php in your current theme.

In my setup, the path to this file is [WORDPRESS_ROOT]/wp-content/themes/[MY_THEME]/functions.php.

Thanks to Ernie Leseberg for writing about this solution.

Leave a Reply

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

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box