Step-by-step guide to set up WP Content Extractor for the first time.
You have a content API at https://api.example.com/posts that returns JSON data, and you want to automatically publish these posts to your WordPress site.
- Download the plugin
- Upload to
wp-content/plugins/wp-content-extractor/ - Activate via WordPress admin
- Go to Settings → Content Extractor
- Enter your source URL:
https://api.example.com/posts - Click Save Changes
Edit functions.php and implement ce_parse_and_publish_content():
function ce_parse_and_publish_content( $body ) {
$data = json_decode( $body, true );
$created_posts = array();
if ( ! empty( $data['posts'] ) ) {
foreach ( $data['posts'] as $post_data ) {
$new_post = array(
'post_title' => wp_strip_all_tags( $post_data['title'] ),
'post_content' => $post_data['content'],
'post_status' => 'publish',
'post_author' => 1,
);
$post_id = wp_insert_post( $new_post );
if ( $post_id && ! empty( $post_data['image'] ) ) {
ce_set_featured_image( $post_id, $post_data['image'] );
}
if ( $post_id ) {
$created_posts[] = $post_id;
}
}
}
return $created_posts;
}- Wait for cron to run (or trigger manually)
- Check WordPress posts to verify content was published
- Verify featured images are attached
- Check WordPress debug log for any errors
- Monitor cron execution via WP-CLI:
wp cron event list - Verify posts are being created regularly
- No posts created: Check API response format matches your parsing logic
- Images not downloading: Verify image URLs are accessible
- Cron not running: Check WordPress cron is enabled