Support » Fixing WordPress » XMLRPC posting

  • Resolved Ashfame


    How can I post through XMLRPC in WordPress using PHP?

    I need full fledged functionality. Please point in some direction.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thanks for the link Michael! Didn’t find that at first.

    Looking forward to more resources (I like the one with examples :P)

    Thanks for the link! 3rd one, that was I wanted exactly.

    Get around with someone who does it every now and then 😉

    The Codex page doesn’t give information on how to send a post request (has everything else, like editing categories, to adding media…but no post request…hello!).

    Trying to do that in Xpostulate (tcl/tk blog client), like this:

    proc wppost {} {
    set content [.txt.txt get 1.0 end]
    set escaped [string map {
    	"<" "<"
    	">" ">"
    	\"  "\""
    	} $content]
    .txt.txt delete 1.0 end
    .txt.txt insert insert $escaped
    set ptext [.txt.txt get 1.0 {end -1c}]
    set time [clock format [clock seconds] -format %G%m%dT%T]
    global mypost
    set mypost "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <member><name>dateCreated</name><value><dateTime.iso8601>$time</ dateTime.iso8601></value></member>
    set plength [string length $ptext]
    set dopost [http::geturl http://$ -query $::mypost -type "text/xml" ]
    set wpstat [http::status $dopost]
    set wpresponse [http::data $dopost]
    toplevel .rsp
    wm title .rsp "Post Status"
    frame .rsp.btns
    grid [tk::label .rsp.btns.lbl -text "WP says: $wpstat\nPost length: $plength"]
    grid [tk::button .rsp.btns.view -text "View Journal" -command {
        set wpu "http://$"
        exec $::brow $wpu &
    [tk::button .rsp.btns.ok -text "DONE" -command {destroy .rsp}]
    frame .rsp.txt
    text .rsp.txt.t -width 80 -height 20
    .rsp.txt.t insert end $wpresponse
    pack .rsp.btns -in .rsp -side top -fill x
    pack .rsp.txt.t -in .rsp.txt -side top -fill x
    pack .rsp.txt -in .rsp -side top -fill x

    Getting this response:

    <?xml version="1.0"?>
              <value><string>parse error. not well formed</string></value>

    I am successfully posting to livejournal, dreamwidth, and other Lj clones using the xmlrpc method, but not finding good documentation on the difference between an LJ post and a WP post.
    Clearly, some LJ props (current_mood, current_music) are not relevant, etc.
    The above xml attempt is based on info from

    Any idea where my xml is malformed?
    Am I missing a relevant or required variable?
    Any ideas?


    @ tonybaldwin –

    Please don’t repost the same question across multiple threads, it makes it hard to follow along. I replied here –

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘XMLRPC posting’ is closed to new replies.