How to make a post to wordpress using the api?


Question

How can I remotely make a post to a user's blog after he/she gives me his login info using the wordpress api? What method do i need to use, what paremeters should it have, etc? Sample code will be great.

I'd prefer to use the XML-RPC api but others will also be acceptable.

1
7
1/24/2010 6:16:53 AM

Accepted Answer

yeah you can use metaWeblog.newPost or blogger.newPost, an example of the first:

http://www.wprecipes.com/post-on-your-wordpress-blog-using-php

uses curl and xmlrpc_encode_request

an example of the second:

http://www.nickycakes.com/post-to-wordpress-remotely-with-xmlrpc-in-php/

yeah and @Francis is correct

6
1/24/2010 9:43:09 PM

I personally use the JSON API plugin. Create a post using:

http://www.example.com/api/create_post/?nonce=123456789&title=My%20Post&status=publish

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon