Title: xmlrpc_wp_insert_post_data help/examples
Last modified: August 31, 2016

---

# xmlrpc_wp_insert_post_data help/examples

 *  [mellett](https://wordpress.org/support/users/mellett/)
 * (@mellett)
 * [10 years ago](https://wordpress.org/support/topic/xmlrpc_wp_insert_post_data-helpexamples/)
 * What class/file should I install the function and add_filter() call in order 
   to intercept the post request?
 * I’ve tried a number of areas, some don’t get called at all, others don’t have
   the data that I’m looking for (xmlrpc.php).
 * Does there also need to be a call to apply_filters(), before the function will
   be called? The problem I’m running into is that I don’t think that the _insert_post()
   function of class-wp-xmlrpc-server.php is ever called which is the only place
   that I’ve found an apply_filters() call for ‘xmlrpc_wp_insert_post_data’.
 * I’d appreciate any thoughts or suggestions because as it stands right now I’m
   just chasing my tail.
 * Thanks
    Andy

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/xmlrpc_wp_insert_post_data-helpexamples/#post-7364413)
 * ‘xmlrpc_wp_insert_post_data’ is the right filter for posts inserted via XML-RPC.
   You can add your filter callback on your theme’s functions.php, but your code
   could be overwritten when the theme updates. To prevent this, create a child 
   theme or a simple plugin to contain your code.
 * You do not need to call `apply_filters()`, `add_filter()` is the only function
   you need to call, plus whatever you do in the filter callback function. Be sure
   your callback returns the post data array to use in the insertion.
 * If you still have trouble, post the code you’re using and someone should be able
   to spot the problem.

Viewing 1 replies (of 1 total)

The topic ‘xmlrpc_wp_insert_post_data help/examples’ is closed to new replies.

## Tags

 * [external](https://wordpress.org/support/topic-tag/external/)
 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/xmlrpc_wp_insert_post_data-helpexamples/#post-7364413)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
