Upload Multiple Media by API
Upload multiple images and media files to your WordPress Media Library through a dedicated REST API endpoint. Upload Multiple Media by API is designed for headless WordPress, mobile apps, external applications, frontend frameworks, and custom integrations that need reliable programmatic media upload
About this tool.
Upload multiple images and media files to your WordPress Media Library through a dedicated REST API endpoint.
Upload Multiple Media by API is designed for headless WordPress, mobile apps, external applications, frontend frameworks, and custom integrations that need reliable programmatic media uploads.
Each uploaded file is validated, optionally optimized, checked for duplicates, added to the WordPress Media Library, and returned with detailed information in the API response.
Video Tutorial
Learn how to upload multiple media files through the WordPress REST API:
Features
- Upload multiple media files in a single REST API request.
- REST API endpoint for programmatic media uploads.
- Authentication support using WordPress Application Passwords.
- Optional ALT text for each uploaded image.
- Image optimization with configurable quality.
- Maximum image width and height controls.
- Duplicate detection using SHA-256 file hashes.
- Configure maximum files per request.
- Configure maximum file size.
- Configure allowed file types.
- Attach uploaded media to an existing post.
- Detailed per-file JSON responses.
- Works with headless WordPress and custom frontend applications.
- WordPress Media Library integration.
REST API
Endpoint:
/wp-json/mmbyapi/v1/upload-multiple-images
Method:
POST
File field:
mmbyapi_file_upload[]
Send multiple files using the same field name.
ALT text field:
mmbyapi_alt_texts[]
ALT text is optional and is matched to uploaded files by array index.
Optional post field:
post_id
Use post_id to attach uploaded media to an existing WordPress post.
Image Optimization
Image optimization can be enabled or disabled from the plugin settings.
When enabled, supported images can be optimized according to the configured quality and maximum dimensions.
Supported optimization formats:
Frequently asked questions.
Can I upload multiple files in one request?
Yes. Add multiple files using the mmbyapi_file_upload[] field.
Can I provide ALT text for uploaded images?
Yes. Use the optional mmbyapi_alt_texts[] field. ALT text is matched to files by array index.
Can I optimize uploaded images?
Yes. Enable Image Optimization in the plugin settings and configure the desired quality and maximum dimensions.
Will images be enlarged?
No. The maximum width and height settings are used to limit oversized images. Smaller images are not enlarged by the optimization process.
Can I disable image optimization?
Yes. Image optimization can be disabled from the plugin settings.
Does the plugin detect duplicate files?
Yes. Duplicate detection uses a SHA-256 content hash to identify matching files.
Can I attach media to a post?
Yes. Provide the optional post_id field with the ID of the existing WordPress post.
Does the plugin require authentication?
No. Authentication is optional and disabled by default for backward compatibility. For production environments, authenticated uploads are recommended.
What happens if some files fail?
The API returns a result for each file. When a request contains both successful and failed uploads, the endpoint returns HTTP 207.
Does the plugin work with headless WordPress?
Yes. The REST API makes it suitable for headless WordPress, Next.js, React, mobile apps, and other external applications.