U Ranket
⌘K

WordPress

Connect Ranket to WordPress to publish generated articles via the REST API. Application Password auth, post or custom post types, Yoast/Rank Math meta.

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/posts and /wp/v2/users/me if so.
  • HTTPS on the site URL. Plain HTTP is rejected by the config validator.

Step-by-step setup

  1. In WP admin, go to Users → Profile (or Users → Your Profile if you have multiple users).
  2. Scroll to Application Passwords at the bottom of the page.
  3. Type Ranket in the New Application Password Name field, then click Add New Application Password.
  4. 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.
  5. In Ranket, open your brand → Webhooks tab → Add endpoint and pick WordPress.
  6. 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.
  7. Optionally set a Post Type, Default Status, Category ID, and Author ID (see below for what each does).
  8. Click Test connection before saving — Ranket hits /wp-json/wp/v2/users/me to confirm the credentials work and the REST API is reachable.

Configuration options

FieldRequiredDefaultWhat it does
siteUrlyesBase URL of the WP install. The REST API is auto-derived as <siteUrl>/wp-json.
usernameyesWP username that owns the Application Password.
applicationPasswordyesThe 24-character Application Password (spaces preserved).
postTypenopostSlug of the post type to publish to. Use a custom post type slug (e.g. guide) to target a CPT.
defaultStatusnopublishOne of publish, draft, pending. publish goes live immediately.
categoryIdnoNumeric WP category ID. When set, every article is filed under this category.
authorIdnoNumeric 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, and status (from defaultStatus).
  • 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 categories and author when categoryId / authorId are 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 (or edit_posts for drafts). Promote the user to Editor or Administrator.
  • Custom post type returns 404 — the CPT slug in postType is wrong, or the CPT wasn’t registered with show_in_rest: true. Verify with GET /wp-json/wp/v2/types.
  • Yoast/Rank Math fields not appearing — both plugins gate register_meta exposure. 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.

See also

  • Webhooks — the underlying delivery contract (HMAC, retries, payload shape).
  • Pricing — endpoint limits per plan.

Was this page helpful?