Back to Community

Why Are My Images Still JPG or PNG? Troubleshooting Converter for Media WebP Issues

Content

If you've installed the 'Converter for Media – Optimize images | Convert WebP & AVIF' plugin but your images are still loading as JPG or PNG in the browser, you're not alone. This is one of the most common support questions for this plugin. The good news is that the issue is almost always related to a few specific configuration or environmental factors, not a fundamental flaw in the plugin.

Why This Happens: It's Usually Not a Bug

The plugin is designed to work transparently. It converts your images to WebP/AVIF and stores them in a separate directory (/wp-content/uploads-webpc/). When a browser that supports modern formats requests an image, the server's rewrite rules (in your .htaccess or Nginx config) silently deliver the converted version. The image URL in your page's HTML will always show the original extension (e.g., .jpg). You cannot check for WebP by looking at the URL or right-clicking to save the image.

How to Properly Check if the Plugin is Working

Before troubleshooting, confirm the plugin is actually not working. The correct method is to use your browser's Developer Tools:

  1. Right-click on your webpage and select Inspect.
  2. Go to the Network tab.
  3. Refresh the page.
  4. In the network log, look for image requests (you can filter by Img).
  5. Click on an image request and look at the Response Headers. If the content-type header says image/webp or image/avif, the plugin is working correctly. If it says image/jpeg or image/png, then proceed with the solutions below.

Common Solutions to WebP Conversion Issues

1. Clear All Caches

This is the most frequent culprit. A server-level cache (Nginx, Varnish, Redis, etc.) or a hosting provider's cache might be serving an old, cached version of the original image. Clear your:

  • WordPress caching plugin cache
  • Server-level cache (if you have access)
  • CDN cache (e.g., Cloudflare)
  • Browser cache (test in an incognito window after clearing)

2. Verify Server Configuration Mode

The plugin offers different modes of operation. If you are on an Nginx server, the recommended via .htaccess mode will not work. You must:

  • Select the Bypassing Nginx mode in the plugin settings.
  • Manually apply the configuration code the plugin provides to your Nginx server block configuration file.

3. Check for Custom Uploads Directory

The plugin by default only works with images in the standard WordPress uploads directory (/wp-content/uploads/). If your site stores images in a custom directory (e.g., /pic/uploads/), the plugin will not convert them. You must use a code snippet to define the custom path. Add the following to your theme's functions.php file:

add_filter( 'webpc_dir_name', function( $path, $directory ) {
    if ( $directory !== 'uploads' ) {
        return $path;
    }
    return 'pic/uploads'; // Replace with your custom directory
}, 10, 2 );

4. Force Redirections for External Domains

If your site uses a CDN or serves images from a different domain (e.g., images.example.com), the redirects may fail. In the plugin's advanced settings, enable the option Force redirections to WebP for external domains.

5. Run the Bulk Optimization

Installing the plugin is not enough. You must convert your existing images. Go to Converter for Media > Bulk Optimization and run the process to generate WebP/AVIF versions of all your media files. New uploads are typically converted automatically, but the initial library must be processed manually.

6. Check for Plugin or Server Conflicts

Other plugins that modify images or alter server rules (like Safe SVG) can sometimes interfere with the rewrite rules. Try temporarily disabling other plugins to see if the issue resolves. Also, ensure your server's PHP extensions (GD or Imagick) are installed and enabled, as they are required for image processing.

When Conversion Might Not Happen

It's important to know that the plugin is designed to be efficient. It will not serve a WebP/AVIF version if the converted file would be larger than the original image. In these cases, the original file is kept to avoid increasing page load times. This is intentional behavior, not an error.

By methodically working through these common issues, most users can successfully resolve problems with images not being served in WebP format. The key is to use the browser's Network tab for accurate verification and to remember that the plugin's operation is meant to be invisible to the end-user.

Related Support Threads Support