XML-RPC for WordPress Developers

Originally published at: http://www.sitepoint.com/xml-rpc-for-wordpress-developers/

XML-RPC is a remote procedure call (one process calling the function of another process via a remote connection) protocol which uses XML to represent data and HTTP to make the calls. Although applications can explicitly provide their own REST APIs for RPC, a standard protocol can help security and provide many other benefits. For example, developers don’t have to design a REST API architecture from scratch and also a single client can be used to make remote procedure calls to various server applications which support the standard protocol. Therefore, XML-RPC was introduced as a standard protocol for RPC.

XML-RPC for WordPress

In this tutorial we’ll look at the different core WordPress functions which can be executed remotely using XML-RPC. This can help us to build tools which can perform various operations on a WordPress installation. One of the greatest example this is the WordPress Mobile App.

Overview of an XML-RPC Protocol Request and Response

To make an XML-RPC request you need to wrap the remote function name and parameters in XML format and then send a POST request using HTTP.

Continue reading this article on SitePoint

The WP REST API which produces the much easier JSON format is set to supersede the XML-RPC protocol later this year (the actual version it will be included is still fuzzy). It would have been much more interesting and beneficial to discuss this up-and-coming feature, rather than the pain-in-the-ass protocol that is the XML-RPC.

1 Like

Thanks for the suggestion @BlueLiquidDesigns - We’ve covered the REST API (http://www.sitepoint.com/wordpress-json-rest-api/) and definitely plan to focus on it in future. Watch this space :smile:

@BlueLiquidDesigns @chrisburgess I agree that JSON APIs are superseding XML APIs everywhere. But there are still a lot of WordPress clients which are using XML-RPC protocol…such as WordPress Mobile App. WordPress is still adding new XML-RPC functions and working on its improvement. So its not outdated rather is under continuous development.

XML-RPC wasn’t covered here so we wanted to document it here. There is nothing wrong in learning both XML-RPC and JSON REST API. For some non JavaScript programmers XML seems to be more suitable.

Thanks.

1 Like

Hmm, that’s a good idea use php-rpc library to request wordpress. Before i was wrote a function to request it, it’s a littile tough, but now you give me a better way to do it.

Thanks

I thought it was a good article @narayanprusty - it is still being used :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.