4

I'd like to manipulate a WordPress website from another program/website. IS there an API already written that provides access, and authentication, to do this?

Ideally, I'll be using a multi-site wordpress instance and I want an outside program to add new sites, send config options to plugins, etc.

3 Answers 3

1

As of Wordpress 4.7 (released December 2016), a REST API is provided out of the box on Wordpress.

As you're probably aware, REST APIs are interfaced with by standard HTTP GET and POST requests, so if you have a Wordpress 4.7 installation, you can access it at this URL, by plugging this into your browser:

http://your.site.com/wp/v2/posts

Further reading:


Important side note:

Because this is turned on be default, because this exposes endpoints that can changes your data (via POST/PATCH/DELETE requests), and because Wordpress prefers you not to disable it, you really really ought to turn on some form of authentication. Thankfully, turning on basic WP logged-in authentication isn't particularly hard, and there are plugins that will enable OAuth.

4

WordPpress platform provides XML-RPC support which you can use to maintain your WP site. You also enable to extend functionality of build in xml-rpc methods to use it for your needs.

1

There are multiple API plugins out there that work very well:

WP-API by Ryan McCue https://github.com/WP-API/WP-API

and JSON API by Dan Phiffer: http://wordpress.org/plugins/json-api/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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