List WordPress Media Library
wp_list_mediaList WordPress media library items with filters for type, search, parent post, and pagination; returns markdown or JSON.
Instructions
List items in the WP media library with filtering and pagination.
Args:
limit (number): Page size, 1-100. Default 20.
offset (number): Pagination offset.
media_type (enum): image | video | audio | file | any. Default 'any'.
search (string): Optional keyword filter.
parent (number): Optional attachment-to-post-ID filter (0 = unattached).
orderby (enum): date | title | id | modified. Default 'date'.
order (enum): asc | desc. Default 'desc'.
response_format (enum): markdown | json. Default 'markdown'.
Returns: Paginated envelope of WPMediaItem objects with shape: { id, date, slug, title, alt_text, caption, description, media_type, mime_type, source_url, file_size, width, height, author_id, attached_to_id }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum results to return (1-100). Default 20. | |
| order | No | Sort direction. | desc |
| offset | No | Number of results to skip for pagination. Default 0. | |
| parent | No | Filter to media attached to this post/page ID. Use 0 for unattached. | |
| search | No | Search term to match against title, caption, alt text. | |
| orderby | No | Sort field. | date |
| media_type | No | Filter to a single media type, or 'any' for all. | any |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |