Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

XML-RPC Blogger API

WordPress supports the Blogger XML-RPC API methods, augmented with additional WordPress-specific functionality (denoted by †) . This support was added in WordPress 1.5.0.

The original Blogger API spec lived at http://plant.blogger.com/api, but is no longer available.

blogger.getUsersBlogs

Returns information about all the blogs a given user is a member of.

Parameters

  • string appkey: Not applicable for WordPress, can be any value and will be ignored.
  • string username
  • string password

Return Values

  • array
    • struct
      • string blogid
      • string url: Homepage URL for this blog.
      • string blogName
      • bool isAdmin
      • string xmlrpc†: URL endpoint to use for XML-RPC requests on this blog.

blogger.getUserInfo

Authenticates and returns basic information about the requesting user.

Parameters

  • string appkey: Not applicable for WordPress, can be any value and will be ignored.
  • string username
  • string password

Return Values

  • struct
    • int userid
    • string nickname
    • string firstname
    • string lastname
    • string url

Notes

  • This method does not return an email value as specified in the original Blogger API spec.

Errors

  • 401

blogger.getPost

Retrieve information about a post.

Parameters

  • string appkey: Not applicable for WordPress, can be any value and will be ignored.
  • int postid
  • string username
  • string password

Return Values

  • struct
    • string postid
    • string userid
    • datetime dateCreated
    • string content: Character-encoded XML, see example:

Example Response

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
      <struct>
        <member>
          <name>userid</name><value><string>1</string></value>
        </member>
        <member>
          <name>dateCreated</name>
          <value><dateTime.iso8601>20110101T12:00:00</dateTime.iso8601></value>
        </member>
        <member>
         <name>content</name>
         <value><string>&lt;title&gt;Hello world!&lt;/title&gt;&lt;category&gt;1&lt;/category>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</string></value>
        </member>
        <member>
          <name>postid</name><value><string>1</string></value>
        </member>
      </struct>
      </value>
    </param>
  </params>
</methodResponse>

Errors

  • 401
    • If the user does not have permission to edit the post.

blogger.getRecentPosts

Retrieve list of recent posts.

Parameters

  • string appkey: Not applicable for WordPress, can be any value and will be ignored.
  • int blogId: Not applicable for WordPress, can be any value and will be ignored.
  • string username
  • string password
  • int numberOfPosts: Optional.

Return Values

Errors

  • If a user cannot edit a post that would be included in the result set, it will be omitted from the response. Therefore, the total number of posts returned may be less than the requested quantity.

blogger.newPost

Create a new post.

Parameters

  • string appkey: Not applicable for WordPress, can be any value and will be ignored.
  • int blogid: Not applicable for WordPress, can be any value and will be ignored.
  • string username
  • string password
  • string content
  • bool publish: Whether to publish the post upon creation or leave it as a draft.

Return Values

  • int postid

Errors

  • 401
    • If publish is false and the user lacks the edit_posts cap.
    • If publish is true and the user lacks the publish_posts cap.

blogger.editPost

Edit an existing post.

Parameters

  • string appkey: Not applicable for WordPress, can be any value and will be ignored.
  • int postid
  • string username
  • string password
  • string content
  • bool publish

Return Values

  • bool true

Errors

  • 401
    • If the user does not have permission to edit this post.
    • If publish is true and the user lacks the publish_posts cap.
  • 404
    • If no post with that postid exists.

blogger.deletePost

Delete an existing post.

Parameters

  • string appkey: Not applicable for WordPress, can be any value and will be ignored.
  • int postid
  • string username
  • string password
  • bool publish: Will be ignored.

Return Values

  • bool true

Errors

  • 401
    • If the user does not have permission to delete this post.
  • 404
    • If no post with that postid exists.

blogger.getTemplate

Not supported. Please use the theme editor to manage your templates.

blogger.setTemplate

Not supported. Please use the theme editor to manage your templates.