WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering how does external app works for wordpress.com or wordpress.org.

Directly connecting to the wordpress database seems a bad idea to me.


  • How can I create an app or get / post data from the wordpress database?
  • Is there a JSON API or XML API format so that I can easily exchange data between the two?
share|improve this question
up vote 5 down vote accepted

WordPress features a very rich XML-RPC interface that you can work with from external applications. It provides you access to most of the functionality you'd have directly in the admin - write posts, edit posts, edit comments, create/edit categories, manage site options, upload files, etc.

As a matter of fact, certain third-party applications are already using this functionality to allow you to manage WordPress remotely - a good example is Windows Live Writer. It works for both self-hosted (.org) sites and sites hosted on WordPress.com.

So if you need to get posts from WordPress, I'd recommend following API calls:

  • metaWeblog.getPost - for retrieving a single post based on its ID.
  • metaWeblog.getRecentPosts - for retrieving a list of recently published posts

You can also create/edit posts with these API calls:

  • metaWeblog.newPost - create a new post
  • metaWeblog.editPost - edit an existing post

There's more information about creating your own application (and an explanation as to why WordPress supports third-party APIs like metaWeblog) in the Codex.

I've also written tutorials on how to use the API and documentation specific to making/parsing metaWeblog API requests.

share|improve this answer

For self-hosted WordPress blogs, you can use the JSON API plugin. I'm working with it on a project right now... it's fairly full-featured OOB, and it's extensible. Documentation is here.

Not sure about wordpress.com blogs.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.