Plugin Documentation

wp_newPost

( xmlrpc; blog_id; username; password; post_type; post_status; post_title; post_author; post_excerpt; post_content; post_format; post_name; post_password; comment_status; ping_status; sticky; post_thumbnail; post_parent; terms; terms; custom_fields; enclosure )

wp_editPost

( xmlrpc; blog_id; username; password; post_id; post_type; post_status; post_title; post_author; post_excerpt; post_content; post_format; post_name; post_password; comment_status; ping_status; sticky; post_thumbnail; post_parent; terms; terms; custom_fields; enclosure )

xmlrpc**
The location of your xmlrpc.php file. It is in the root of your WordPress install. May look like http://yourwebsite.com/xmlrpc.php or something like http://yourwebsite.com/wordpress/xmlrpc.php If you receive the error The response could not be parsed your xmlrpc is not valid. To test, type your xmlrpc url into the address bar of your web browser. The site that loads should say, XML-RPC server accepts POST requests only.

XMLRPC in browser

XMLRPC in browser

blog_id**
Try 1. If its not 1, you can get it using wp_getUsersBlogs

username**
This is the username you enter on your WordPress dashboard at yourwebsite.com/wp-login.php

password**
This is the username you enter on your WordPress dashboard at yourwebsite.com/wp-login.php

post_id
This is the username you enter on your WordPress dashboard at yourwebsite.com/wp-login.php

post_type
If left blank, the default post type is post.
The post types included in the default WordPress installation are:

post
page
attachment

You can add custom post types. You can retrieve the list of existing post types using wp_getPostTypes.

post_status
If left blank, the default post status is draft.
The post types included in the default WordPress installation are:

draft
pending
publish
private

You can add custom post statuses. You can retrieve the list of existing post statuses using wp_getPostStatusList. If you pass an unavailable post status, the passed parameter is ignored and the default is used.

post_title
This is simply the title of the post.

post_author
If left blank, this will default to the account associated with username used in the username parameter. If you’d like a different post author, use the wp_getAuthors function to retrieve the user id (numerical) for the selected author and enter that for this parameter.
post_excerpt
Not all WordPress themes use this. Click
here for the WordPress definition of post excerpt.

post_content
This is the body content of your WordPress post. HTML is welcome here.

post_format
If left blank, the default post format is standard. The post formats included in the default WordPress installation are:

standard
audio
status
gallery
quote
link
image
chat
aside
video

Here is the official WordPress definition of post formats. You can retrieve the list of existing post formats using wp_getPostFormats. WARNING If you pass an unavailable post format, the passed parameter is ignored and the default is used.

post_name
This is different than post title. If (and only if) you have your permalinks set to include the post name will this entry matter at all. You can pass it even if your permalinks are not set to include it. Post name is also sometimes called “slug”. Spaces will be replaced with hyphens. Most other punctuation will simply be removed.

post_password
This is a post-specific password. See here for more information. You will most likely just want to leave this blank.

comment_status
If left blank, the default comment status is open. The available comment statuses are:

open
closed

ping_status
This parameter correlates with the “Allow trackbacks and pingbacks on this page” checkbox seen when editing a WordPress page in your WordPress dashboard.
If left blank, the default ping status is open.
The available ping statuses are:

open
closed

sticky
This correlates with the “Stick this post to the front page” checkbox seen when editing a post within your WordPress dashboard. For more information, click here. If left blank, the default sticky value is false. The available sticky values are:

  • true
  • false

post_thumbnail
Not all themes use post thumbnail. For those that do, simply pass the numeric attachment id for the media you would like to place here. attachment_id is one of many xml attributes returned by wp_uploadFile. Here’s the WordPress definition of a post thumbnail.

post_parent
If you want your page to be a child page of another page, simply pass the parent post id here.

terms
The default taxonomies are category, tag, link category and post formats. You can also create custom taxonomies. Categories and tags are automatically created when passed here as parameters.

Here is the correct XML format for passing as a terms parameter:

<records>

<taxonomy>

<key>category</key>

<value>

<name>fruit</name>

<name>vegetable</name>

</value>

</taxonomy>

<taxonomy>

<key>post_tag</key>

<value>

<name>yes</name>

<name>no</name>

</value>

</taxonomy> </records>

To remove tags, you need to pass the full key/value bit but remove the proper name. WARNING Once any tags have been added, you can only go down to one tag. You can not remove all tags.

custom_fields

Here is the official WordPress definition of custom fields. For wp_newPost, the custom_fields parameter should look like this:

<records>

<custom_field>

<key>name_of_custom_field</key>

<value>value</value>

</custom_field>

<custom_field>

<key>name_of_another_custom_field</key>

<value>this is another value</value>

</custom_field> </records>

After wp_newPost, you’ll need to store the returned id values for each custom field. For wp_editPost, the custom_fields parameter should look like this:

<records>

<custom_field>

<key>name_of_custom_field</key>

<value>value</value>

<id>178</id>

</custom_field>

<custom_field>

<key>name_of_another_custom_field</key>

<value>this is another value</value>

<id>180</id>

</custom_field> </records>

If you do not pass the id value for each previously created custom field each time wp_editPost is run, you will end up with duplicate custom field name/value pairs. Even if the name/value pair is not changed at all! Also, the key (custom field name) can NOT be changed. For custom fields newly created within a wp_editPost, no id is required.

wp_deletePost

xmlrpc
blog_id
username
password
post_id

wp_getAuthors

xmlrpc
blog_id
username
password

wp_getMediaItem

xmlrpc
blog_id
username
password
attachment_id

wp_getMediaLibrary

xmlrpc
blog_id
username
password
number
offset
parent_id
mime_type

wp_getPost

xmlrpc
blog_id
username
password
post_id

wp_getPostFormats

xmlrpc
blog_id
username
password

wp_getPosts

xmlrpc
blog_id
username
password

wp_getPostStatusList

xmlrpc
blog_id
username
password

wp_getPostTypes

xmlrpc
blog_id
username
password

wp_getTaxonomies

xmlrpc
blog_id
username
password

wp_getTerms

xmlrpc
blog_id
username
password
taxonomy
number
offset
orderby
order
hide_empty
search

wp_getUsersBlogs

xmlrpc
username
password

wp_newTerm

xmlrpc
blog_id
username
password
name
taxonomy
slug
description
parent