15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started
28.10.2024

Images Not Displaying on Your Website: Causes, Fixes & Best Practices

Broken images are more than a cosmetic nuisance — they silently destroy user trust, inflate bounce rates, and send negative signals to search engines. Whether you're running a WordPress blog, an e-commerce store, or a custom web application, image loading failures can make your site look unprofessional and cost you real traffic and revenue.

The good news? The vast majority of image display problems stem from a small set of well-understood root causes, and every single one of them is fixable. This comprehensive guide walks you through every common reason images fail to load, provides actionable solutions for each, and shows you how to prevent these issues from recurring — all within a modern Linux hosting environment.

Why Broken Images Are a Serious Problem

Before diving into fixes, it's worth understanding the full impact of broken images:

  • SEO damage: Search engine crawlers index image content. Missing images mean missing alt-text signals, broken structured data, and lower content quality scores.
  • Core Web Vitals: Image loading failures can disrupt Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS) metrics — both of which directly affect your Google rankings.
  • User experience: A broken image icon is an immediate trust signal that something is wrong with your site.
  • Conversion rates: For e-commerce sites, product images that fail to load can directly kill sales.

If you're hosting on a properly configured VPS Hosting environment with NVMe storage and root access, you have every tool you need to diagnose and resolve these issues quickly and permanently.

The 11 Most Common Causes of Images Not Displaying (and How to Fix Each One)

This is the single most frequent cause of broken images on the web. If the src attribute in your HTML or the url() value in your CSS points to a location where no file exists, the browser simply cannot retrieve the image.

What it looks like:

<!-- Broken: wrong directory -->
<img src="/img/photo.jpg" alt="Team photo">

<!-- Correct: actual file lives in /images/ -->
<img src="/images/photo.jpg" alt="Team photo">

How to fix it:

  1. Open your browser's Developer Tools (press F12) and navigate to the Network tab.
  2. Filter by "Img" and reload the page. Any image returning a 404 Not Found status has a broken path.
  3. Cross-reference the path in your HTML/CSS against the actual file structure on your server using an FTP client (such as FileZilla) or your hosting control panel's file manager.
  4. Correct the path in your code, or move the file to the expected location.

Pro tip: Use root-relative paths (e.g., /images/photo.jpg) rather than relative paths (e.g., ../images/photo.jpg) wherever possible. Root-relative paths are unambiguous regardless of the page's location in your directory structure.

2. Case-Sensitivity Issues on Linux Servers

This is a trap that catches developers who build sites on Windows or macOS (both case-insensitive filesystems) and then deploy to a Linux server (which is strictly case-sensitive).

On a Linux server:

    Photo.jpg and photo.jpg are two entirely different files.
    An HTML reference to photo.jpg will return a 404 if the actual file is named Photo.jpg.
    
    How to fix it:
    
    Establish a naming convention and stick to it. The industry standard is all lowercase, with hyphens instead of spaces (e.g., team-photo.jpg).
    Audit your existing files using SSH:
    
      find /var/www/html/images -name "*.jpg" | sort
    
    Rename any files that don't match their references. On Linux, use:
    
      mv Photo.jpg photo.jpg
    
    If you're using WordPress, the Media Library stores filenames as uploaded — so re-uploading with corrected names is the cleanest fix.
    
    3. Missing or Deleted Image Files
    Sometimes images simply aren't there — they were never uploaded, were accidentally deleted, or were lost during a server migration.
    How to diagnose it:
    Check via SSH whether the file exists:
    ls -la /var/www/html/images/photo.jpg
    Or use your control panel's file manager to browse to the expected directory.
    How to fix it:
    
    Re-upload the missing image via FTP, SFTP, or your hosting control panel.
    If the image was deleted and you don't have a local copy, check your server backups. A well-configured VPS Hosting plan with automated backups can be a lifesaver in this scenario.
    For WordPress sites, check whether the image still exists in wp-content/uploads/ and regenerate thumbnails if necessary using the Regenerate Thumbnails plugin.
    
    4. Incorrect File Permissions
    Linux file permissions control which users and processes can read, write, or execute files. If an image file's permissions are too restrictive, the web server (typically running as www-data or nginx) won't be able to read and serve it.
    Correct permission settings:
    
    
    
    
    Resource
    Recommended Permission
    
    
    
    
    Files
    644 (owner: read/write; group & others: read)
    
    
    Directories
    755 (owner: read/write/execute; group & others: read/execute)
    
    
    
    
    How to check and fix permissions via SSH:
    # Check current permissions
    ls -la /var/www/html/images/
    
    # Fix file permissions recursively
    find /var/www/html/images/ -type f -exec chmod 644 {} ;
    
    # Fix directory permissions recursively
    find /var/www/html/images/ -type d -exec chmod 755 {} ;
    How to fix via FTP:
    Right-click the file or folder in your FTP client, select File Permissions, and enter the numeric value (644 for files, 755 for directories).
    Warning: Never set image files to 777. This grants write access to everyone and is a significant security vulnerability.
    5. Unsupported or Incompatible Image Formats
    Not all image formats are universally supported across all browsers and devices. Common compatibility issues include:
    
    
    
    
    Format
    Issue
    
    
    
    
    WebP
    Not supported in very old browsers (IE, old Safari)
    
    
    AVIF
    Limited support in older browser versions
    
    
    TIFF
    Generally not supported in web browsers
    
    
    SVG
    May have rendering issues in some legacy environments
    
    
    HEIC
    Not natively supported in most browsers
    
    
    
    
    How to fix it:
    
    Use JPEG for photographs, PNG for images requiring transparency, and WebP as a modern, high-efficiency alternative with a JPEG/PNG fallback.
    Implement the HTML <picture> element to serve modern formats with graceful fallbacks:
    
      <picture>
        <source srcset="/images/photo.webp" type="image/webp">
        <source srcset="/images/photo.jpg" type="image/jpeg">
        <img src="/images/photo.jpg" alt="Descriptive alt text">
      </picture>
    
    Convert images using tools like ImageMagick (available on your server), Squoosh, or GIMP.
    
    6. Hotlink Protection Blocking External Images
    If your site references images hosted on a third-party server (a practice known as "hotlinking"), that server's hotlink protection may be blocking your requests. This is a common and legitimate security measure that prevents bandwidth theft.
    How to identify it:
    The image URL in your HTML points to a different domain (e.g., https://anotherdomain.com/images/photo.jpg). The image loads fine when you visit that domain directly but shows a broken icon or a placeholder image on your site.
    How to fix it:
    The only reliable solution is to self-host your images:
    
    Download the image to your local machine.
    Upload it to your own server's image directory.
    Update the src attribute in your HTML to point to your own hosted copy.
    
    This also improves your site's reliability — you're no longer dependent on a third party's uptime or policies.
    7. Browser Caching Issues
    Browsers aggressively cache static assets like images to improve performance. However, this can cause problems when:
    
    An image has been updated on the server but the browser still serves the old cached version.
    A cached version of a page references an image path that no longer exists.
    
    How to fix it for end users:
    Instruct users to perform a hard refresh:
    
    Windows/Linux: Ctrl + Shift + R or Ctrl + F5
  • macOS: Cmd + Shift + R
  • How to fix it at the server level (cache-busting):

    Append a version query string to image URLs so browsers treat them as new assets when content changes:

    <img src="/images/banner.jpg?v=2" alt="Banner">

    Or configure proper Cache-Control headers in your web server configuration. For Nginx:

    location ~* .(jpg|jpeg|png|gif|webp|svg)$ {
        expires 30d;
        add_header Cache-Control "public, no-transform";
    }

    8. Slow Server Response or Connectivity Issues

    If your server is overloaded, experiencing high latency, or if a user has a slow or unstable internet connection, images may time out before they finish loading — appearing as broken or simply never rendering.

    How to diagnose server-side issues:

    # Check server load
    top
    htop
    
    # Check disk I/O
    iostat -x 1
    
    # Check active connections
    ss -s

    How to fix it:

    • Optimize your images: Compress images before uploading. Tools like TinyPNG, ImageOptim, and the command-line tool jpegoptim can reduce file sizes by 50–80% with minimal visible quality loss.
    • Implement lazy loading: Use the native loading="lazy" attribute so below-the-fold images only load when the user scrolls to them:
      <img src="/images/photo.jpg" alt="Description" loading="lazy">
    • Use a CDN: A Content Delivery Network distributes your images across global edge servers, dramatically reducing latency for users far from your origin server.
    • Upgrade your hosting: If your server is consistently overloaded, it may be time to move to a more powerful plan. Dedicated Servers offer maximum resources and consistent performance for high-traffic sites.

    9. Incorrect Image URLs in CSS

    Background images defined in CSS are a frequent source of broken image issues, particularly because CSS files are often located in subdirectories (e.g., /css/style.css), which affects how relative paths are resolved.

    Common mistake:

    /* CSS file is at /css/style.css */
    /* This looks for /css/images/background.jpg — probably wrong */
    .hero {
        background-image: url('images/background.jpg');
    }

    Correct approach — use root-relative paths:

    /* This always resolves from the site root, regardless of CSS file location */
    .hero {
        background-image: url('/images/background.jpg');
    }

    How to debug CSS background images:

    1. Open Developer Tools (F12).
    2. Select the element with the missing background.
    3. In the Styles panel, hover over the background-image URL — the browser will show whether the resource was found or returned an error.

    10. Mixed Content (HTTP Images on HTTPS Sites)

    If your website is served over HTTPS but any of your images are referenced using http:// URLs, modern browsers will block those images as "mixed content" — a security measure to prevent man-in-the-middle attacks.

    What it looks like in the console:

    Mixed Content: The page at 'https://yoursite.com' was loaded over HTTPS,
    but requested an insecure image 'http://yoursite.com/images/photo.jpg'.
    This content should also be served over HTTPS.

    How to fix it:

    1. Update all image URLs to use https:// instead of http://.
    2. For WordPress sites, use the Better Search Replace plugin to find and replace all http://yourdomain.com instances with https://yourdomain.com in the database.
    3. Add the following to your <head> section as a safety net (this upgrades all HTTP requests to HTTPS automatically):
       <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    1. Ensure you have a valid SSL certificate installed. If you haven't already, SSL Certificates are essential for any modern website and protect both your users and your SEO rankings.

    11. CDN Configuration Issues

    If you're using a Content Delivery Network to serve images, a misconfiguration or CDN outage can cause images to fail globally even when your origin server is perfectly healthy.

    How to diagnose CDN issues:

    • Temporarily bypass the CDN by accessing your site via its direct IP address or by disabling the CDN in your DNS settings.
    • If images load correctly when the CDN is bypassed, the issue is CDN-specific.
    • Check your CDN provider's status page for reported incidents.

    How to fix it:

    • Purge the CDN cache — stale cached versions of deleted or moved images can persist on CDN edge nodes.
    • Verify CDN origin settings — ensure the CDN is pointing to the correct origin server and port.
    • Check CDN URL rewriting rules — some CDN configurations rewrite image URLs in ways that break paths.
    • If the issue is persistent, consider temporarily disabling the CDN and serving images directly from your origin server while you investigate.

    Step-by-Step Troubleshooting Workflow

    When you encounter broken images, follow this systematic diagnostic process:

    Step 1: Open Browser Developer Tools

    Press F12 (or right-click → Inspect) and navigate to the Network tab. Filter by Img. Reload the page and look for any images returning 404, 403, or 5xx status codes.

    Step 2: Test the Image URL Directly

    Copy the image URL from the src attribute and paste it directly into your browser's address bar. This tells you immediately whether the file is accessible at that path.

    Step 3: Check the Server-Side File

    SSH into your server and verify the file exists, has correct permissions, and is in the expected location:

    ls -la /var/www/html/images/
    stat /var/www/html/images/photo.jpg

    Step 4: Verify the Protocol

    Ensure the image URL uses https:// and not http:// if your site has SSL enabled.

    Step 5: Test Across Multiple Browsers

    Load the page in Chrome, Firefox, Safari, and Edge. If the image loads in some browsers but not others, the issue is likely format compatibility or a browser-specific cache problem.

    Step 6: Check for CMS or Plugin Conflicts

    If you're using WordPress or another CMS, deactivate plugins one by one to identify any that may be interfering with image delivery. Switching to a default theme (e.g., Twenty Twenty-Four) can also help isolate theme-specific issues.

    Step 7: Review Server Error Logs

    Check your web server's error log for relevant entries:

    # Nginx
    tail -n 100 /var/log/nginx/error.log | grep -i "image|photo|jpg|png"
    
    # Apache
    tail -n 100 /var/log/apache2/error.log | grep -i "image|photo|jpg|png"

    Preventive Best Practices to Avoid Future Image Issues

    Fixing broken images reactively is frustrating. Here's how to build a workflow that prevents these issues from arising in the first place:

    Best PracticeWhy It Matters
    Use a consistent lowercase naming conventionEliminates case-sensitivity errors on Linux servers
    Always self-host imagesEliminates hotlink protection and third-party dependency issues
    Compress images before uploadingReduces load times and server resource consumption
    Use root-relative paths in HTML and CSSPrevents path resolution errors when files move
    Enforce HTTPS site-wideEliminates mixed content issues
    Implement automated backupsEnables recovery from accidental deletion
    Use <picture> with format fallbacksEnsures compatibility across all browsers
    Regularly audit with a broken link checkerCatches issues before users do
    Add descriptive alt attributes to all imagesImproves SEO and accessibility

    Choosing the Right Hosting for Reliable Image Delivery

    The quality of your hosting infrastructure plays a significant role in image delivery performance and reliability. Key factors to consider:

    • Storage type: NVMe SSDs deliver dramatically faster read speeds than traditional HDDs or SATA SSDs, which directly impacts how quickly image files are served.
    • Server resources: Adequate CPU and RAM ensure your server can handle concurrent image requests without throttling.
    • Uptime guarantees: A reliable host with 99.9%+ uptime means your images are always accessible.
    • Root access: Full root access on a VPS lets you configure web server settings, file permissions, and caching headers precisely as needed.

    For growing websites with significant image libraries, VPS Hosting offers the ideal balance of performance, control, and cost-efficiency. For high-traffic sites or image-heavy applications such as photography portfolios or large e-commerce platforms, Dedicated Servers provide unshared resources and maximum throughput.

    If you're managing multiple websites or prefer a user-friendly interface for file management, Shared Web Hosting with cPanel gives you an intuitive file manager, one-click image uploads, and straightforward permission controls — an excellent starting point for smaller sites.

    Conclusion

    Broken images are one of the most visible and damaging issues a website can experience, but they are also among the most fixable. The root causes — incorrect paths, permission errors, case-sensitivity mismatches, mixed content, format incompatibilities, and CDN misconfigurations — all have clear, well-established solutions.

    The key is a systematic approach: use your browser's Developer Tools to identify the error, trace it back to its root cause using the diagnostic steps outlined above, apply the appropriate fix, and then implement preventive practices to stop it from happening again.

    With a well-configured hosting environment, proper file organization, consistent naming conventions, and a valid SSL certificate, your images will load reliably, quickly, and correctly — for every user, on every device, every time.

    15%

    Save 15% on All Hosting Services

    Test your skills and get Discount on any hosting plan

    Use code:

    Skills
    Get Started