WordPress - Get Media
Description
Section titled “Description”This module allows querying and searching files in the WordPress media library. Supports filters by file type (images, videos, PDF) and text search.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”| Field | Description | Example |
|---|---|---|
url | WordPress site base URL | https://my-site.com |
username | WordPress username | admin |
application_password | Application password generated in WordPress | xxxx xxxx xxxx xxxx |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | WordPress credential |
| media_id | text | No | Specific ID. If empty, lists all |
| search | text | No | Search term |
| mime_type | select | No | Filter: All, Images, Videos, PDF |
| per_page | number | No | Results per query (1-100). Default: 10 |
Output
Section titled “Output”{ "success": true, "media": [ { "id": 789, "title": { "rendered": "logo-empresa" }, "source_url": "https://misitio.com/wp-content/uploads/2025/01/logo.png", "mime_type": "image/png", "media_details": { "width": 800, "height": 600, "sizes": { "thumbnail": { "source_url": "..." } } } } ], "total": 45}Usage Example
Section titled “Usage Example”List all images
Section titled “List all images”{ "mime_type": "image"}Search by name
Section titled “Search by name”{ "search": "logo"}Get specific file by ID
Section titled “Get specific file by ID”{ "media_id": "789"}API Used
Section titled “API Used”- Endpoint:
GET /wp-json/wp/v2/media - Documentation: WordPress REST API - Media
- The media ID can be used as featured_media in the Create/Update Post nodes
- The source_url field contains the public file URL
- media_details includes dimensions and thumbnails for images
Related Nodes
Section titled “Related Nodes”- WordpressUploadMedia - Upload new files to the library
- WordpressCreatePost - Create post with featured image
- WordpressCreatePage - Create page with featured image