Posting via HTTP requests?

the XML-RPC protocol can do that for you, look up how to use it with curl: http://shoaibmir.wordpress.com/2009/03/10/using-curl-for-xmlrpc-calls/ and what the actual tags are: http://codex.wordpress.org/XML-RPC_Support

Working code example of PHP XML-RPC connex to site?

How complex do you want the example to be? This outputs “Hello”. $client = new WP_HTTP_IXR_Client(‘http://example.com/xmlrpc.php’); $client->query(‘demo.sayHello’); echo $client->getResponse(); This outputs “9”. $client = new WP_HTTP_IXR_Client(‘http://example.com/xmlrpc.php’); $client->query(‘demo.addTwoNumbers’, 4, 5); echo $client->getResponse(); This gets the WordPress version: $client = new WP_HTTP_IXR_Client(‘http://example.com/xmlrpc.php’); $client->query(‘wp.getOptions’, 0, ‘username’, ‘password’, ‘software_version’); $response = $client->getResponse(); echo $response[‘software_version’][‘value’]; Source: Me, 4 years ago: … Read more

Create a new post in wordpress with XML-RPC with the correct GUID?

This is an annoying problem, but there is a way to get the correct link if I do: $my_page_ask = array( ‘link’, ‘guid’ ); $params = array(0,$username,$password,$my_page_id, $my_page_ask); $clientresult = $client->query(‘wp.getPost’, $params); $post = $client->getResponse(); The string link contains the correct permalink if: $my_page[“post_status”] = “publish”; It doesn’t work on draft and the string guid … Read more

Storing an XML Response (Transient)?

According to this ticket: Cannot serialize object wrapping 3rd party library structs. Must serialize the xml (to a string) and store that to session and reload the xml when restoring from session When you are storing object in transient it gets serialized and not all objects are capable of that correctly. Store textual XML data … Read more

Simply deleting XMLRPC file

You shouldn’t delete that file – it will be restored after update – so deleting it makes no sense (and it shouldn’t be treated as security fix). You can disable XMLRPC using filter: add_filter(‘xmlrpc_enabled’, ‘__return_false’); And even block access to that file. Below code for Apache (sandrodz showed code for nginx): <Files xmlrpc.php> Order deny,allow … Read more

Restrict access to xmlrpc.php

There are plugins for that: e.g. http://wordpress.org/plugins/disable-xml-rpc/ You can also write a filter yourself add_filter(‘xmlrpc_enabled’, ‘__return_false’); You can simply add this code your theme functions.php (located in wp-content/themes/your_theme). However, you are advised to create a child theme (http://codex.wordpress.org/Theme_Development) so that your modification does not disappear when you update the theme. Alternatively, you can create your … Read more