MCP Server for WordPress

Build 25.0.9440

CreateMedia

Uploads a new media file, such as an image or video, to the WordPress site's media library and attaches it to a specified post or page.

Stored Procedure Specific Information

Call this procedure to create media. Note: The Status column only accepts the following values: publish, future, draft, pending, and private. To create a media you must specify the following column: FileLocation. For example:

EXEC CreateMedia Title='MediaTitle', FileLocation='C:/myImages/image.png', Caption='This is an uploaded media.';

Input

Name Type Description
Title String The title assigned to the media item in WordPress.
Date Datetime The date and time to assign to the uploaded media item, based on the site's configured timezone.
DateGMT Datetime The date and time to assign to the uploaded media item, expressed in Greenwich Mean Time (GMT).
Status String Specifies the publication status of the uploaded media item, such as inherit, publish, or private.
AuthorId Integer Specifies the ID of the WordPress user who created or uploaded the media item.
CommentStatus String Specifies whether the uploaded media item can receive comments. Supported values include open and closed.
PingStatus String Specifies whether the media item accepts pings or trackbacks from external sites.
Caption String The caption text to display with the media item in WordPress.
Description String The description text for the media item in WordPress.
PostId Integer The unique identifier of the post or page that the uploaded media item is associated with or attached to in WordPress.
FileLocation String The file path or publicly accessible URL of the media file that uploaded to WordPress.

Result Set Columns

Name Type Description
Success String Indicates whether the media upload completed successfully.
Id String The unique identifier assigned to the media item after it is successfully uploaded to WordPress.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9440