Ranket connects to your WordPress site and publishes generated articles automatically. Each article ships with title, slug, HTML body, excerpt, meta title/description, FAQ schema, and image URLs. Updates and deletes propagate the same way — no manual copy-pasting once the integration is live.
What you need before you start
- A self-hosted WordPress install or a WordPress.com Business+ plan (lower tiers don’t expose the REST API for write operations).
- An admin user. Application Passwords work for any role with
edit_posts, but publishing reliably (categories, custom statuses, custom post types) requires Administrator or Editor scope. Don’t use a Subscriber/Contributor account. - The WordPress REST API enabled at
/wp-json/. It’s on by default, but some hardening plugins (Wordfence, iThemes Security, Disable REST API) block it — whitelist/wp/v2/postsand/wp/v2/users/meif so. - HTTPS on the site URL. Plain HTTP is rejected by the config validator.
Step-by-step setup
- In WP admin, go to Users → Profile (or Users → Your Profile if you have multiple users).
- Scroll to Application Passwords at the bottom of the page.
- Type
Ranketin the New Application Password Name field, then click Add New Application Password. - Copy the 24-character password (shown with spaces, e.g.
abcd EFGH ijkl MNOP qrst UVWX). WordPress only shows it once — store it somewhere safe. - In Ranket, open your brand → Webhooks tab → Add endpoint and pick WordPress.
- Fill in your Site URL (no trailing slash, e.g.
https://example.com), the WP Username (the account that generated the password), and paste the Application Password exactly as shown — including the spaces. - Optionally set a Post Type, Default Status, Category ID, and Author ID (see below for what each does).
- Click Test connection before saving — Ranket hits
/wp-json/wp/v2/users/meto confirm the credentials work and the REST API is reachable.
Configuration options
| Field | Required | Default | What it does |
|---|---|---|---|
siteUrl | yes | — | Base URL of the WP install. The REST API is auto-derived as <siteUrl>/wp-json. |
username | yes | — | WP username that owns the Application Password. |
applicationPassword | yes | — | The 24-character Application Password (spaces preserved). |
postType | no | post | Slug of the post type to publish to. Use a custom post type slug (e.g. guide) to target a CPT. |
defaultStatus | no | publish | One of publish, draft, pending. publish goes live immediately. |
categoryId | no | — | Numeric WP category ID. When set, every article is filed under this category. |
authorId | no | — | Numeric WP user ID. Defaults to the user that owns the Application Password. |
What gets sent
Each article.published event creates a post via POST /wp-json/wp/v2/<postType>s with:
title,slug,content(HTML body),excerpt, andstatus(fromdefaultStatus).- SEO meta keys for both Yoast SEO (
_yoast_wpseo_title,_yoast_wpseo_metadesc) and Rank Math (rank_math_title,rank_math_description) — populated automatically and read by whichever plugin you have active. - Optional
categoriesandauthorwhencategoryId/authorIdare set.
Image URLs and JSON-LD schema (Article + FAQPage) are present in the original webhook payload but are not auto-uploaded to the WP media library — your theme should render them from the post body and meta.
Updates and deletes
When Ranket optimizes an article, the same endpoint receives an article.updated event and the post is updated in place via PUT /wp-json/wp/v2/<postType>s/<id>. Deletions fire article.deleted and the post is removed with ?force=true (skips the trash).
Troubleshooting
- 401 Unauthorized — the Application Password is wrong, or you’re using your normal login password (Application Passwords are different). Regenerate and re-paste, keeping the spaces.
- 404 on
/wp-json/— the REST API is disabled or blocked. Check your security plugin (Wordfence, iThemes, Disable REST API), and confirm pretty permalinks are enabled (Settings → Permalinks, anything other than “Plain”). - 403 Forbidden — the user role lacks
publish_posts(oredit_postsfor drafts). Promote the user to Editor or Administrator. - Custom post type returns 404 — the CPT slug in
postTypeis wrong, or the CPT wasn’t registered withshow_in_rest: true. Verify withGET /wp-json/wp/v2/types. - Yoast/Rank Math fields not appearing — both plugins gate
register_metaexposure. Install the WP REST API Meta Endpoints helper or upgrade to recent plugin versions (3.x+ for Yoast, 1.0.50+ for Rank Math) which register the meta keys automatically.