Fixing broken image links in WordPress
Broken image links in WordPress occur when uploaded images don’t display correctly in posts or pages. Instead of the image, you may see a placeholder or a missing file icon. On ruachost.com, this issue is usually caused by incorrect file permissions or misconfigured paths.
Common Causes
Section titled “Common Causes”- Incorrect file permissions on the
wp-content/uploadsdirectory. - Images uploaded to the wrong directory.
- Migration errors (site moved without updating paths).
- Corrupted database entries pointing to missing files.
Step‑by‑Step Resolution
Section titled “Step‑by‑Step Resolution”1. Check File Permissions
Section titled “1. Check File Permissions”-
Log in to cPanel.
-
Open File Manager.
-
Navigate to:
/home/username/public_html/wp-content/uploads(Replace
usernamewith your hosting account username.) -
Ensure:
- Directories are set to 755.
- Files are set to 644.
-
Update permissions if necessary.
2. Verify Upload Path
Section titled “2. Verify Upload Path”-
In WordPress, go to Settings → Media.
-
Confirm that the upload path is set to:
wp-content/uploads -
Correct the path if it points elsewhere.
3. Clear Cache
Section titled “3. Clear Cache”- If you use caching plugins (e.g., LiteSpeed Cache, WP Rocket), clear the cache.
- Also clear CDN cache if using Cloudflare or another provider.
4. Re‑Upload Missing Images
Section titled “4. Re‑Upload Missing Images”- If files are missing, re‑upload them via the WordPress Media Library.
- Update posts/pages to point to the correct image URLs.
5. Database Check (Advanced)
Section titled “5. Database Check (Advanced)”- Log in to phpMyAdmin.
- Open your WordPress database.
- Check the
wp_poststable for entries withpost_type = attachment. - Verify that the
guidfield points to the correct image URL. - Update incorrect entries if needed.