Install
openclaw skills install wordpress-oauthStart and complete WordPress.com OAuth and publish posts through the WordPress.com REST API. Use when you need to generate an authorization URL, exchange callback code for an access token, validate token health, or publish draft/published posts to a WordPress.com or Jetpack-connected site.
openclaw skills install wordpress-oauthUse this skill to run a human-in-the-loop OAuth flow and publish posts with a stored bearer token.
{baseDir}/wp_oauth_skill.py{baseDir}/oauth_state.json{baseDir}/credentials.jsonThis skill stores state and credentials in files inside this skill directory.
Run the script with Python 3:
python3 {baseDir}/wp_oauth_skill.py --help
python3 {baseDir}/wp_oauth_skill.py begin-oauth \
--client-id "$WPCOM_CLIENT_ID" \
--redirect-uri "$WPCOM_REDIRECT_URI" \
--scope "posts media" \
--blog "$WPCOM_SITE"
Returns auth_url and state. Open the URL, approve access, then copy the callback URL.
python3 {baseDir}/wp_oauth_skill.py exchange-token \
--client-id "$WPCOM_CLIENT_ID" \
--client-secret "$WPCOM_CLIENT_SECRET" \
--redirect-uri "$WPCOM_REDIRECT_URI" \
--callback-url "https://example/callback?code=...&state=..."
Validates CSRF state, exchanges code for token, and writes credentials to {baseDir}/credentials.json.
python3 {baseDir}/wp_oauth_skill.py token-info --client-id "$WPCOM_CLIENT_ID"
Checks token validity with WordPress token-info endpoint.
python3 {baseDir}/wp_oauth_skill.py publish-post \
--site "$WPCOM_SITE" \
--title "My post" \
--content "<p>Hello from OpenClaw</p>" \
--status draft
Publishes a post via POST /rest/v1.1/sites/$site/posts/new using the stored token.
begin-oauth.auth_url in browser and authorize.exchange-token.token-info.publish-post.credentials.json or client secrets.draft.begin-oauth if callback state fails or auth code expires.