If you’ve moved articles using the WordPress importer and uploaded images via FTP, but the images aren’t showing up in the WordPress Media Library, it means the images are not registered in the WordPress database. WordPress needs to “see” these images as attachments in its database to display them in the Media Library.
Here’s a step-by-step guide to fix the issue:
1️⃣ Use a Plugin to Re-index the Media Library
The easiest way to register your FTP-uploaded images in the WordPress Media Library is by using a plugin. This method avoids manual work.
Best Plugin for the Job:
- Media Sync
- Add From Server
- Regenerate Thumbnails
Steps:
- Install “Media Sync” Plugin:
- Go to Plugins > Add New.
- Search for “Media Sync”.
- Install and activate the plugin.
- Run Media Sync:
- Go to Media Sync (it will appear in the WordPress dashboard menu).
- The plugin will scan the
/wp-content/uploads/
folder. - Select all the images you uploaded via FTP.
- Click Import to Media Library.
- Regenerate Thumbnails (Optional, if images don’t show up properly)
- Install the Regenerate Thumbnails plugin.
- Go to Tools > Regenerate Thumbnails.
- Run the process to regenerate thumbnails for your images.
Advantages:
- Automatically scans and registers files in the uploads folder.
- Saves time and avoids the need for SQL queries or database edits.
2️⃣ Re-scan Media Library Using “Add From Server”
If Media Sync doesn’t work as expected, use the Add From Server plugin.
Steps:
- Install “Add From Server” Plugin:
- Go to Plugins > Add New.
- Search for “Add From Server”.
- Install and activate the plugin.
- Scan Your Uploads Directory:
- Go to Media > Add From Server.
- Select the folder where you uploaded images via FTP (/wp-content/uploads/your-folder/).
- Select all files and click Import.
- Regenerate Thumbnails (Optional)
- If images don’t show properly, regenerate thumbnails using the Regenerate Thumbnails plugin.
Advantages:
- Simple UI and supports bulk imports.
- Works perfectly for FTP-uploaded images.
3️⃣ Manually Add Image Entries to the WordPress Database (Advanced)
If plugins aren’t an option, you can manually add images to the database. WordPress tracks images in the wp_posts
and wp_postmeta
tables.
Steps:
- Log in to phpMyAdmin (or use a MySQL client like MySQL Workbench).
- Insert Image Records into
wp_posts
:- Insert a new row with these fields:
post_title
: The image filename (e.g.,image-name.jpg
).post_type
: Set this toattachment
.post_mime_type
: Image type (e.g.,image/jpeg
orimage/png
).post_status
: Set it toinherit
.post_parent
: Set to0
or the ID of the post it belongs to.
- Insert a new row with these fields:
- Add Metadata to
wp_postmeta
:- Attach the
_wp_attached_file
meta key, which should contain the relative path to the file (e.g.,2024/10/image-name.jpg
).
- Attach the
SQL Query Example:
Note: This method is more technical and error-prone. It’s recommended to use a plugin instead.
4️⃣ Check File Permissions
If images are in the uploads folder but not visible, permissions might be incorrect.
Steps:
- Connect to the server via FTP or SSH.
- Navigate to
/wp-content/uploads/
. - Set permissions for all files to
644
and folders to755
.- Files:
chmod 644 image.jpg
- Folders:
chmod 755 /path/to/uploads/
- Files:
Command (for SSH users)
- Clear browser cache or hard refresh the Media Library page.
5️⃣ Clear WordPress Cache
Sometimes, caching plugins or server-side cache can prevent newly uploaded files from appearing.
Steps:
- Clear Cache from Caching Plugin (like WP Super Cache, W3 Total Cache, etc.).
- Clear Browser Cache.
- If using a CDN (like Cloudflare), purge the CDN cache.
- Refresh the Media Library.
6️⃣ Verify Upload Path in WordPress
Sometimes, the upload path isn’t properly configured in WordPress.
Steps:
- Go to Settings > Media.
- Ensure that the Upload Path is set to:
- Check for any custom paths in the wp-config.php file:
- If there’s a path mismatch, correct it and save changes.
7️⃣ Regenerate Thumbnails
Even if images are showing, they might not be displayed properly due to missing thumbnails.
Steps:
- Install the Regenerate Thumbnails plugin.
- Go to Tools > Regenerate Thumbnails.
- Click Regenerate Thumbnails.
This process will generate all the thumbnail sizes that WordPress needs to display in the Media Library.
Summary of Solutions
Issue | Solution |
---|---|
Images not showing | Use Media Sync or Add From Server plugins |
Images show, but no thumbnails | Run Regenerate Thumbnails |
Permissions error | Set permissions to 644 for files, 755 for folders |
Upload path issue | Ensure wp-content/uploads is set in WordPress settings |
Cache Issue | Clear WordPress, browser, and CDN cache |
Database Issue | Manually register images in wp_posts and wp_postmeta tables |
Which Method Should You Choose?
- For Beginners: Use Media Sync or Add From Server plugins.
- For Developers: Run the SQL Query or use a custom PHP script.
- For Admins: Verify upload paths, file permissions, and cache.
These methods are the most effective for making sure your images appear in WordPress after uploading via FTP. Let me know if you’d like more guidance on any step
Fixing missing WordPress images after an FTP upload is simpler than it seems. By using tools like Media Sync and Add From Server, you can easily register images without touching the database.
For more technical users, database entries and SQL queries offer a precise solution. Remember to double-check your file permissions, upload paths, and cache to ensure images display correctly. With these methods, your WordPress Media Library will be fully synced, and your website will look complete. If you’re ever stuck, plugins are your best friend. Follow these steps, and you’ll never have to worry about missing images again!
Rishi Sunak, experienced blogger & WordPress developer, excels in digital marketing & SEO. Delivers high-quality content at https://blog.spinbot.uk/, enhancing online visibility & earning potential.