Back to blog
11 min read Import Guides

How to Register FTP/SFTP Uploaded Files in the WordPress Media Library

Files uploaded through FTP or SFTP can be present in wp-content/uploads and still be missing from the WordPress Media Library. The transfer puts files on disk; WordPress also needs attachment records and media metadata.

To register those files, open Import Export by RockStarLab → Import, select Media Sync, and scan the folder inside your uploads directory. Review the results, choose Skip Duplicates and Keep in current directory, then start synchronization. The files become selectable under Media → Library without uploading them again through your browser.

The steps cover the admin workflow, duplicate handling, repeat scans and the same operation through an AI agent. Media Sync is available in the free plugin.

When to use FTP/SFTP media registration

Use this workflow when your files are already on the destination server: an agency has delivered an image folder, you have copied assets from an older site, or a bulk SFTP transfer has finished. It also works for supported documents, audio and video files, subject to the file types allowed by your WordPress installation.

Your starting point Choose this workflow
Files already inside the destination uploads directory Media Sync: scan and register local server files.
A spreadsheet with image or document URLs Import Media Library files from CSV or Excel so the importer can download them.
A full site backup with its original database Restore the WordPress backup when you need the original attachment records and relationships.

Registering files does not reconstruct old attachment IDs, captions, featured-image assignments or product galleries from filenames. It creates media items you can use in WordPress. Assigning those items to posts or products is a separate step.

Before you start

  • Install and activate Import Export by RockStarLab.
  • Complete your FTP/SFTP transfer into a dedicated subfolder of the WordPress uploads directory.
  • Make sure WordPress can read the files and write image metadata and generated sizes.
  • Back up the database and uploads before a large registration job.

Media Sync does not connect to an FTP server or transfer files from your computer. Use your hosting file manager or SFTP client for that first step. Upload only files intended to be publicly accessible; ordinary uploads directories are not private document storage.

For a small first run, use a folder like this:

wp-content/uploads/ftp-tutorial-demo/
├── studio-blue.png
├── notes.txt
└── details/
    └── studio-green.png

With recursive scanning enabled and Images Only selected, the two PNG files are the candidates. The text file is outside that filter.

Step 1: build the Media Hash Index

If your Media Library already contains files, open Import Export by RockStarLab → Tools. Find Media Hash Index and click Start scan. Wait for indexing to finish before running a synchronization that uses hash-based duplicate detection.

The counters show existing media files, indexed files and files without a hash. If unreadable or missing files remain, investigate their paths and permissions. The index reads attachment files and stores their hashes; the files stay exactly where they are.

Media Hash Index in Import Export by RockStarLab with indexing complete
Build the hash index before comparing incoming files with existing Media Library attachments.

A hash comparison examines file contents. An unchanged image renamed from studio-blue.png to renamed-blue.png can still match the same attachment. A resized, recompressed or edited image has different bytes and may be treated as a different file. This is exact-file duplicate detection, not visual similarity detection.

Step 2: open Media Sync and choose the uploads folder

Go to Import Export by RockStarLab → Import. Select the Media Sync content type and click Next Step.

Enter ftp-tutorial-demo in Folder Path, or use Browse to select the folder. The path is relative to your site’s uploads directory. Do not paste an image URL, an FTP address or your hosting account’s absolute filesystem path into this field. Use / only when you deliberately want to scan the uploads root.

Enable Include files from subdirectories to include the details folder. Set File Types to Images Only. For other projects, the selector also offers video, audio, document and custom-extension filters.

Media Sync folder path set to ftp-tutorial-demo with recursive image scanning
Use an uploads-relative folder path and narrow the scan to the file types you need.

Step 3: scan and review the original files

Click Scan Folder. This displays candidates without registering them. Review the names, paths and sizes, then leave checked only the files you want in the Media Library.

For the example folder, the list contains studio-blue.png and details/studio-green.png. The total is two files. Reviewing a specific folder is easier than working through an entire site’s uploads tree.

Media Sync scan results showing two selected original PNG files
Review the discovered files before starting synchronization.

Step 4: configure duplicate handling and file operations

For a first registration that keeps the existing server paths, use these settings:

Setting Example choice Why use it?
Duplicate Detection MD5 Hash Identify identical file contents even after a rename.
Duplicate Handling Skip Duplicates Avoid creating another attachment for a detected duplicate.
File Operation Keep in current directory Register files at their existing uploads locations.
Batch Size 3 A small starting batch for this example, not a universal performance target.
Real Media Library Disabled Optional virtual-folder integration is unnecessary for registration.
Media Sync settings using MD5 Hash, Skip Duplicates and Keep in current directory
Keep files in place and skip duplicates when adding server assets to the Media Library.

The other detection choices are Filename Match and Filesize + Filename. These can be useful when naming is controlled, but renamed copies are a reason to prefer the hash index.

Overwrite Existing and Rename and Import serve different purposes from skipping duplicates. Do not select them simply to rerun the same folder. Similarly, review Copy Files and Move Files before changing File Operation: moving files can affect links that point to their former locations.

With Keep in current directory, the registered media depends on the original files remaining there. Do not delete that folder as temporary transfer data after registration.

If you use Real Media Library, its optional integration can organize imported files into virtual folders. The standard Media Library works without it; the option is unavailable when the integration is inactive.

Step 5: synchronize and verify the Media Library

Click Start Synchronization and wait for completion. Read the imported, skipped and failed counts rather than assuming every selected file created a new attachment. A skipped duplicate is an expected outcome when you chose Skip Duplicates.

Media Sync completed with two imported images and no failures
The completion screen reports the result of registering the selected files.

Open Media → Library. Search for the filenames if the library is large. Both example images should appear as individual media items.

WordPress Media Library showing the newly registered blue and green images
Registered server files are now available in the WordPress Media Library.

Open an attachment and check its image preview, file URL, file type and dimensions. With Keep in current directory, the example blue image retains a URL ending in /uploads/ftp-tutorial-demo/studio-blue.png. Add a meaningful title, alt text and caption where appropriate, then select the image in your post or product editor.

WordPress can generate smaller image sizes during registration according to the sizes configured by the site. These are normal companion files for the same attachment; they should not become separate gallery items. The WordPress attachment metadata documentation explains how those sizes are recorded.

Repeat scans: skip existing media without importing thumbnails

After registering a folder, you can add more originals and scan it again. Media Sync excludes generated image sizes recorded in WordPress attachment metadata, while retaining the main attachment files and newly uploaded files in the results. Keep MD5 Hash and Skip Duplicates enabled to skip originals that are already registered.

For example, adding studio-orange.png gives you a new image to register. An unchanged copy of the blue file named renamed-blue.png is still a duplicate when compared with the indexed blue attachment.

The generated-size filter uses media records, not a filename pattern. A standalone original named banner-300x200.png remains a candidate. If you copied a whole uploads folder from another site without its attachment metadata, its old thumbnails may still appear: select the originals you intend to register. Media Sync cannot infer every file’s history from its name.

Register server files with an AI agent

An AI agent connected to this WordPress site’s MCP server can scan the folder and start the same Media Sync operation. Follow the WordPress AI-agent connection guide first. Enable the required abilities and use an account permitted to manage media.

Without the plugin, WordPress 7.1.5 gives a connected agent only three read-only abilities for site, user and environment information. The exports, imports and syncs in the requests below are abilities of Import Export by RockStarLab.

The files must already exist in the destination uploads directory. The Media Sync ability does not perform an SFTP upload. Ask the agent to discover the current abilities and read their schemas before execution.

Prompt 1: inspect the folder before changing anything

On the connected WordPress site, discover the available abilities and read the schema for rsl-ie/media-scan-folder. Scan ftp-tutorial-demo recursively for images. Show all returned uploads-relative file paths and sizes, following pagination if needed. Do not register, move, overwrite or delete any files.

Scanning returns candidates, not a promise that every candidate is new. The agent should preserve the exact returned paths for the next step.

Prompt 2: register only the approved files

Register only ftp-tutorial-demo/studio-blue.png and ftp-tutorial-demo/details/studio-green.png. Read the current schemas for the Media Hash Index and Media Sync abilities first. Prepare the hash index if needed, reporting any unreadable files. Use folder_path ftp-tutorial-demo, selected_files containing only those two paths, duplicate_check hash, duplicate_handling skip, file_operation keep, batch_size 3 and rml_integration false. Start the job with rsl-ie/media-sync-start, then check rsl-ie/media-sync-status until it finishes. Report created, skipped and failed items and their attachment IDs. Do not overwrite or move files.

The relevant abilities are rsl-ie/media-hash-stats, rsl-ie/media-hash-build, rsl-ie/media-scan-folder, rsl-ie/media-sync-start and rsl-ie/media-sync-status. Hash building is batched; the agent should follow the returned cursor until completion when indexing a library.

A start response with a job ID means the job was accepted, not that registration has finished. Background processing depends on WordPress cron. If a job stays pending, check the site’s cron setup and Jobs Log instead of repeatedly starting new jobs.

Prompt 3: add another image and check the result

Scan ftp-tutorial-demo again. Register only the returned path ftp-tutorial-demo/studio-orange.png, using hash duplicate detection, skip duplicates and keep the current directory. Wait for completion and report its attachment ID. Then open that attachment in Media Library and verify the preview, URL, file type and dimensions. If you cannot access the browser, say which checks still need to be done manually.

WordPress attachment editor showing the orange image registered through an AI agent
Open the attachment after the agent finishes to verify the actual image and file details.

The expected outcome is a usable WordPress attachment, not just a successful tool response. For repeat operations, a skipped item that points to the existing attachment can be correct. Use clear file selections and avoid asking the agent to import every file it can find.

Troubleshooting FTP files missing from WordPress

Symptom What to check
The folder is not found Use a path relative to the current site’s uploads directory. Confirm the transfer finished on the correct server.
Some files are absent from the scan Check recursion, the selected file-type filter and allowed upload types. Registered generated image sizes are intentionally excluded.
The scan includes too many files Choose a narrower subfolder and deselect unrelated originals. For a copied legacy uploads tree, review old thumbnails without metadata.
An identical image is imported again Build the hash index, choose MD5 Hash and Skip Duplicates, and confirm the files really have identical contents.
The image appears but will not load Check its attachment URL, filesystem permissions and whether someone moved or deleted the registered source file.
Processing stalls or reports failures Inspect the failed item details and Jobs Log. Check cron for background jobs, available memory, disk space and image-processing support; retry a small selection after resolving the cause.

Once the media is available, you can use it in your content or continue with a WooCommerce product import. For other transfer methods, browse the written import and export tutorials.

Frequently asked questions

Why are FTP uploaded images missing from the WordPress Media Library?

FTP and SFTP copy files to the server but do not create WordPress attachment records. Media Sync registers supported files already inside the uploads directory so they appear in Media Library.

Is Media Sync available in the free plugin?

Yes. Server-folder Media Sync is available in the free Import Export by RockStarLab plugin. Optional integrations and other import workflows may have different requirements.

Where is Media Sync in the current interface?

Open Import Export by RockStarLab → Import, select Media Sync, then click Next Step.

Which folder path should I enter?

Enter a path relative to the WordPress uploads directory, such as ftp-tutorial-demo. Do not enter an FTP address or image URL. Use / to scan the uploads root only when that broader scope is intended.

Can I register files without moving them?

Yes. Choose Keep in current directory. Leave the registered source files in place afterwards because WordPress continues to use them.

Will repeated scans import generated thumbnails?

Generated image sizes recorded in WordPress attachment metadata are excluded from scan results. Unregistered thumbnails copied from another site may still appear when their metadata is absent, so review those files manually.

Can duplicate detection recognize renamed images?

Yes. With a prepared Media Hash Index, MD5 Hash detection can match unchanged file contents despite a different filename. Resized or recompressed images may have different hashes.

No. Files alone do not restore the original attachment IDs, captions or post and product relationships. Use a suitable metadata import or full backup restoration when those records are required.

Can an AI agent register FTP uploaded files?

Yes. A connected agent can use the Media Sync abilities to scan uploads-relative paths, register an explicit file selection and check job status. The files must already be on the destination server; these abilities do not upload them through FTP.

Do I need Real Media Library?

No. You can register files in the standard WordPress Media Library without it. Its virtual-folder integration is optional.

Dmitriy
About author

Dmitriy

WordPress Developer with 15+ years of commercial experience. Elite Author on ThemeForest and creator of custom WordPress plugins. Passionate about clean code, performance optimization, and building useful tools for the WordPress community.

JOIN THE CONVERSATION

Comments 0

Have a question or a tip to share? Leave it below.

Leave a comment

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

We store your name, email and comment to show and moderate it; your email is never published. Spam protection is provided by Cloudflare Turnstile and profile pictures by Gravatar. See our Privacy Policy.


Try the plugin with no risks!

New users get 1 month with access to all premium features. Experience the most powerful WordPress data engine today.

Download Now
Get PRO for FREE