Fix Missing WordPress Images: Import via FTP & Media Library

Fix Missing WordPress Images After FTP Upload

Have you uploaded images to WordPress via FTP, but they’re not showing in the Media Library? Don’t worry — you’re not alone! This common issue happens because WordPress needs to “register” those images in its database. Luckily, there are several simple solutions to get your images to appear properly. From using powerful plugins like Media Sync and Add From Server to advanced manual methods like database queries, we’ve got you covered. In this guide, you’ll learn the most effective ways to fix the issue step-by-step. Say goodbye to missing images and hello to a fully updated WordPress Media Library.

 

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:

  1. Install “Media Sync” Plugin:
    • Go to Plugins > Add New.
    • Search for “Media Sync”.
    • Install and activate the plugin.
  2. 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.
  3. 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.
See also  15 Top One Page Wordpress Theme: Make Professional Website with a Single Page Design

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:

  1. Install “Add From Server” Plugin:
    • Go to Plugins > Add New.
    • Search for “Add From Server”.
    • Install and activate the plugin.
  2. 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.
  3. 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:

  1. Log in to phpMyAdmin (or use a MySQL client like MySQL Workbench).
  2. 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 to attachment.
      • post_mime_type: Image type (e.g., image/jpeg or image/png).
      • post_status: Set it to inherit.
      • post_parent: Set to 0 or the ID of the post it belongs to.
  3. 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).

SQL Query Example:

sql

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:

  1. Connect to the server via FTP or SSH.
  2. Navigate to /wp-content/uploads/.
  3. Set permissions for all files to 644 and folders to 755.
    • Files: chmod 644 image.jpg
    • Folders: chmod 755 /path/to/uploads/

Command (for SSH users)

bash
find /path/to/your/wp-content/uploads/ -type d -exec chmod 755 {} \;
find /path/to/your/wp-content/uploads/ -type f -exec chmod 644 {} \;
  1. 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:

  1. Clear Cache from Caching Plugin (like WP Super Cache, W3 Total Cache, etc.).
  2. Clear Browser Cache.
  3. If using a CDN (like Cloudflare), purge the CDN cache.
  4. Refresh the Media Library.

6️⃣ Verify Upload Path in WordPress

Sometimes, the upload path isn’t properly configured in WordPress.

Steps:

  1. Go to Settings > Media.
  2. Ensure that the Upload Path is set to:
    bash
    wp-content/uploads
  3. Check for any custom paths in the wp-config.php file:
    php
    define( 'UPLOADS', 'wp-content/uploads' );
  4. 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:

  1. Install the Regenerate Thumbnails plugin.
  2. Go to Tools > Regenerate Thumbnails.
  3. Click Regenerate Thumbnails.

This process will generate all the thumbnail sizes that WordPress needs to display in the Media Library.

See also  Move Wordpress Site To Another Host: Step-by-Step Host & Domain Transfer

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!

Leave a comment