Images on my WordPress/IIS site aren’t displaying despite being successfully selected and appearing in the Media View.

Web Design Images

If images are not displaying on your WordPress site running on IIS 10, even though they appear in the Media Library, it is likely due to one or more of the following issues:


1. Verify File Permissions

WordPress requires the correct read/write permissions for media files.

Fix Permissions

  1. Navigate to: C:\inetpub\wwwroot\your-site\wp-content\uploads
  2. Right-click the uploads folder > Properties.
  3. Go to the Security tab and click Edit.
  4. Select IUSR and IIS_IUSRS, then ensure:
    • Read & Execute โœ”
    • List Folder Contents โœ”
    • Read โœ”
    • Write (for uploads) โœ”
  5. Click Apply and OK.

2. Check IIS MIME Type Settings

If images arenโ€™t displaying, IIS may not be serving the file type correctly.

Add Missing MIME Types

  1. Open IIS Manager.
  2. Select your site.
  3. Click MIME Types.
  4. Check if the necessary image types exist:
    • .jpg โ†’ image/jpeg
    • .png โ†’ image/png
    • .gif โ†’ image/gif
    • .svg โ†’ image/svg+xml
  5. If any are missing:
    • Click Add on the right.
    • Enter the extension and MIME type.
    • Click OK.

3. Disable Hotlink Protection

Some security plugins or IIS Rewrite Rules may block direct access to images.

Check .htaccess (if applicable)

If you migrated from Apache, check for hotlink protection rules.

Check IIS Rewrite Rules

  1. Open IIS Manager.
  2. Select your site and open URL Rewrite.
  3. Look for rules blocking image requests (wp-content/uploads).
  4. Disable or modify any restrictive rules.

4. Check File Upload Location

  1. Go to WordPress Admin > Settings > Media.
  2. Verify the upload directory:
    • Should be: wp-content/uploads
    • If it shows an incorrect path, update wp-config.php:define('UPLOADS', 'wp-content/uploads');
  3. Save changes and refresh your site.

5. Ensure IIS Has Static Content Enabled

IIS needs Static Content enabled to serve images.

Enable Static Content

  1. Open Server Manager.
  2. Click Manage > Add Roles and Features.
  3. Go to Web Server (IIS) > Common HTTP Features.
  4. Check Static Content.
  5. Click Install.

6. Regenerate Thumbnails

If image thumbnails are missing or corrupted, regenerate them.

Use a Plugin

  1. Install Regenerate Thumbnails from the WordPress plugin store.
  2. Run the tool to regenerate all images.

7. Check for Broken Links

  1. Right-click the missing image and Copy Image Address.
  2. Open it in a new tab.
  3. If it returns a 404 or 403 error, check:
    • Permissions (uploads folder).
    • Incorrect file path.
    • IIS rules blocking access.

8. Restart IIS

After making changes, restart IIS.

Run this command in PowerShell:

iisreset

Final Check

  • Clear browser cache.
  • Open Developer Tools (F12) > Network.
  • Look for blocked requests or incorrect paths.

These steps should resolve the issue. Let me know if you need more help! ๐Ÿš€


One response to “Images on my WordPress/IIS site aren’t displaying despite being successfully selected and appearing in the Media View.”

  1. Thank you for this comprehensive guide! Troubleshooting image display issues on WordPress/IIS can indeed be quite perplexing, and youโ€™ve broken it down into clear, actionable steps.

    Iโ€™d like to add a few more insights that might help others facing similar problems:

    1. **Caching Solutions:** If youโ€™re using caching plugins (like W3 Total Cache or WP Super Cache), ensure that you clear the cache after making changes. Caches can sometimes serve outdated versions of your site, preventing new uploads from showing up correctly.

    2. **CDN Considerations:** If youโ€™re utilizing a Content Delivery Network (CDN) for media files, ensure that the CDN is properly configured to pull images from your server. Sometimes, a mismatch or missed state between your server and CDN can lead to image loading issues.

    3. **Inspect Console Errors:** Itโ€™s also worthwhile to check for any JavaScript errors in the browser’s console (F12). Some themes or plugins might conflict and cause images not to display properly, so pinpointing such conflicts could lead to quick fixes.

    4. **File Types & Image Sizes:** Double-check the types and sizes of images being uploaded. Extremely large images can sometimes fail to load or display correctly due to timeout issues.

    5. **IIS Logs:** For more advanced troubleshooting, consider looking into IIS logs. They often contain detailed error messages that can help identify issues not immediately visible through other methods.

    By addressing these additional aspects, you might be able to expedite troubleshooting and

Leave a Reply

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