Debug WordPress xml-rpc

As we discussed in another post here: and here: there are a lot of difficulties with WordPress xml-rpc.

With these curl lines here you will be able to make a quick test and see the responses from the xml-rpc server.

WordPress xmlrpc error 200

We wrote some days ago about a problem with xmlrpc.php in WordPress due to having WP_DEBUG active. Today I have discovered another issue that may prevent xmlrpc.php from working correctly.

This time the problem is that when trying to write with xmlrpc protocol, the response is an error 200. The issue discovered today had to do with the theme being used. This theme had a function defined that was causing some type of return that affected the usage of xmlrpc.

The result was that when loading the page /xmlrpc.php there was a redirection to one post. This was very strange. The normal response has to be:

XML-RPC server accepts POST requests only.

I could identify the problem when I compared the theme I was using with another one (take twentyten for example) where I was getting the correct response.

Since I knew that WordPress loads functions.php every time you load a page, I looked at it and, by trial and error, found that there was a function causing the problem. I wish there was more debugging information about it… but I have not been capable of having access to it.

Now I have put among my to-dos, the task of learning more about how to debug in PHP. I have quickly read through this promising post by IBM:

WordPress debug mode and xml-rpc problems

This post is about using xml-rpc to post in WordPress. If you experience problems of this type:

32700:parse error. not well formed


32300:transport error - HTTP status code was not 200

It can be many things, but we have been crazy checking all the configuration until we realised that the problem was coming from the fact that the WordPress installation had the WP_DEBUG flag set to TRUE

define('WP_DEBUG', 'true');

And you should change it to FALSE