WordPress sites can receive PostPenguin posts automatically using our official plugin. Posts are published directly to your WordPress site with full SEO metadata.
Official WordPress Plugin Available!
We have an official WordPress plugin that handles everything automatically. No coding required - just install, configure your secret key, and you're ready to receive posts.
๐ Quick Setup with Official Plugin
Step 1: Install the Plugin
- 1Download
postpenguin.phpfrom the plugin repository - 2Upload to your WordPress
wp-content/plugins/directory - 3Go to Plugins in WordPress admin and click Activate
Step 2: Configure the Plugin
- 1Go to Settings โ PostPenguin in your WordPress admin
- 2Enter your Secret Key (this must match your PostPenguin site settings)
- 3Click Save Changes
- 4Copy the Webhook URL shown on the settings page
Step 3: Add to PostPenguin
- 1In PostPenguin, go to Dashboard โ Add Site
- 2Enter your WordPress site URL
- 3Paste the webhook URL from the plugin settings page
- 4Enter the same secret key you configured in WordPress
๐ What the Plugin Does
โ Automatic Publishing
Posts are published immediately when approved in PostPenguin
โ Signature Verification
HMAC-SHA256 verification ensures requests come from PostPenguin
โ Tag Support
Tags from PostPenguin are automatically added to WordPress posts
โ Update Detection
Existing posts are updated instead of creating duplicates
โ๏ธ Plugin Settings
The plugin adds a settings page at Settings โ PostPenguin with:
- Secret Key โ Your shared secret for webhook verification
- Webhook URL โ The URL to enter in PostPenguin (displayed automatically)
- Status โ Shows whether the plugin is configured correctly
Your webhook URL will be:
https://your-site.com/wp-json/postpenguin/v1/posts๐งช Testing Your Setup
After configuring the plugin, test the webhook:
# Generate a test signature
SECRET="your-secret-key"
PAYLOAD='{"postPenguinId":"test_123","title":"Test Post","slug":"test-post","contentHtml":"<p className="text-gray-700">Test content</p>"}'
SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" | cut -d' ' -f2)
# Send test webhook
curl -X POST https://your-site.com/wp-json/postpenguin/v1/posts \
-H "Content-Type: application/json" \
-H "X-PostPenguin-Secret: $SIGNATURE" \
-d "$PAYLOAD"If successful, you'll see a response like:
{
"success": true,
"postId": 123,
"postUrl": "https://your-site.com/test-post/",
"action": "created"
}๐ง Advanced: Custom Integration
If you prefer to build your own integration instead of using the plugin, you can create a custom webhook handler:
<?php
// Add to your theme's functions.php or a custom plugin
add_action('rest_api_init', function () {
register_rest_route('postpenguin/v1', '/posts', [
'methods' => 'POST',
'callback' => 'handle_postpenguin_webhook',
'permission_callback' => '__return_true'
]);
});
function handle_postpenguin_webhook(WP_REST_Request $request) {
// Verify signature
$signature = $request->get_header('X-PostPenguin-Secret');
$secret = get_option('postpenguin_secret_key');
$body = $request->get_body();
$expected = hash_hmac('sha256', $body, $secret);
if (!hash_equals($expected, $signature)) {
return new WP_Error('unauthorized', 'Invalid signature', ['status' => 401]);
}
$data = json_decode($body, true);
// Create WordPress post
$post_id = wp_insert_post([
'post_title' => sanitize_text_field($data['title']),
'post_name' => sanitize_title($data['slug']),
'post_content' => wp_kses_post($data['contentHtml']),
'post_status' => 'publish',
'post_type' => 'post',
]);
if (is_wp_error($post_id)) {
return new WP_Error('error', 'Failed to create post', ['status' => 500]);
}
// Save PostPenguin ID for future updates
update_post_meta($post_id, '_postpenguin_id', $data['postPenguinId']);
return [
'success' => true,
'postId' => $post_id,
'postUrl' => get_permalink($post_id)
];
}๐ Troubleshooting
Plugin not appearing in WordPress admin
- โข Check that the file is named
postpenguin.php - โข Verify it's in the
wp-content/plugins/directory - โข Check PHP version is 7.0 or higher
"Invalid signature" error
- โข Ensure the secret key in WordPress matches PostPenguin exactly
- โข Check for extra spaces or line breaks in the secret key
- โข Verify the webhook URL is correct
Posts not appearing
- โข Check Posts โ All Posts in WordPress admin
- โข Look for posts with status "Published"
- โข Check WordPress error logs for any issues
403 Forbidden or REST API errors
- โข Ensure WordPress permalinks are enabled (Settings โ Permalinks)
- โข Check if a security plugin is blocking REST API requests
- โข Verify your server allows POST requests to the REST API
๐ Plugin Requirements
- WordPress 5.0 or higher
- PHP 7.0 or higher
- REST API enabled (enabled by default in WordPress)
- HTTPS recommended for security
Need Help?
Check our webhook documentation for technical details, or contact support for custom integrations.