Title: XML-RPC newPost broke when site changed to https
Last modified: August 22, 2016

---

# XML-RPC newPost broke when site changed to https

 *  [Kchun](https://wordpress.org/support/users/kchun/)
 * (@kchun)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/xml-rpc-newpost-broke-when-site-changed-to-https/)
 * Code was working fine until the wordpress.com blog changed to the remote site
   from http to https. Now it gives a 301 error when I try to remote post.
 * I looked into the code and it appears that it strips off the http or https so
   I’m not getting why I can’t connect to the xmlrpc.php and get a 301 error.
 * I’ve tried with several xml-rpc libraries including the WordPress class-xmlrpc.
   php to no avail. They all give 301 error (had to do a little code modification
   to find out what was really going on.)
 * If I directly access [https://Orlandolunes.wordpress.com/xmlrpc.php](https://Orlandolunes.wordpress.com/xmlrpc.php)
   in a browser, it gives the proper message: “XML-RPC server accepts POST requests
   only.”
 * I also tried giving it port 443 instead of 80.
 *     ```
       $client = new IXR_Client(https://Orlandolunes.wordpress.com/xmlrpc.php);
   
       	$content['title'] = "Karen Testing";
               $content['description'] = "test post";
   
               if (!$client->query('metaWeblog.newPost',443, $sUsername,$sPassword, $content, false))
               {
                   die( 'Error while creating a new post' . $client->getErrorCode() ." : ". $client->getErrorMessage());
               }
               $ID =  $client->getResponse();
       ```
   

The topic ‘XML-RPC newPost broke when site changed to https’ is closed to new replies.

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [remote posting](https://wordpress.org/support/topic-tag/remote-posting/)
 * [xmlrpc](https://wordpress.org/support/topic-tag/xmlrpc/)

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 0 replies
 * 1 participant
 * Last reply from: [Kchun](https://wordpress.org/support/users/kchun/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/xml-rpc-newpost-broke-when-site-changed-to-https/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
