Anytime I upload an image to the media library it shows up as a png. And when I want to use it in a post WordPress tells me I can't use a png.

How does this happen? The site is in development and running on localhost.

I have changes the .htaccess file to allow bigger files to be uploaded. But after deleting these rules nothing changes. Nothing in functions.php about the media library.

How does this happen? Where should I look to troubleshoot this?

  • Probably one of the wp-includes/class-wp-image-editor* files. Are you set up to use ImageMagick or GD to recompress images? I've not heard of either changing JPGs to PNGs though. – Rup Oct 1 '19 at 9:01
  • 1
    Welcome to WPSE! The problem you are reporting should be the result of some plugin or custom development. There is nothing in Wordpress Core that would change the file type. I have also never encountered any preclusion to adding a PNG to a post. You definitely have a mystery on your hands. I recommend disabling plugins and/or changing themes until you stop having this problem. It is a major pain, but that should help you identify the source of your problem. – Mike Baxter Oct 2 '19 at 0:50
  • As @Mike Baxter said, this error is caused by some plugin, So please try disabling the plugins to find the culprit. – Ujjawal Poonia Jun 4 '20 at 12:22
  • @UjjawalPoonia No it is not there is no plugin being used – Latheesh V M Villa Jun 4 '20 at 23:01
  • 1
    Which theme are you using? – AndrewL64 Jun 7 '20 at 12:02

A peek into the WP core file - wp-admin/includes/file.php confirms it is not WP which is doing this. Can you try the following:

  1. Check functions.php file in your active theme
  2. Try switching to other themes and check if the issue persists
  3. Try deactivating all the plugins and then activating them one by one and checking the issue
  4. Check your wp-config.php file
  5. Also, can you check whether this plugin is able to convert images from png to jpg or not - https://wordpress.org/plugins/png-to-jpg/

and please reply with the results.


Try searching for Imagick::setImageFormat, Imagick or setImageFormat in your theme, if you're using free/bought theme, it would be helpful to mention it as @AndrewL64 mentioned


as OceanG and @Jonas said maybe you are using a plugin or theme that have a function to convert your images. try to search for Imagick into your installed and activated plugins and the active theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.