Pageoptimized
API and integrations

Connect WordPress drafts

WordPress publishing creates draft posts through the WordPress REST API. PageOptimized verifies the username and application password before saving the connector.

WordPress publishing creates draft posts through the WordPress REST API. PageOptimized verifies the username and application password before saving the connector.

Official WordPress references:

Before you start

  1. Confirm the WordPress site is reachable over HTTPS.
  2. Confirm the REST API is enabled.
  3. Confirm you have a WordPress user that can create posts.
  4. Open PageOptimized in another tab.
  5. Go to the project.
  6. Open Publishing > Connections.
  7. Find the WordPress card.

Step 1: create a WordPress publishing user

You can use your own account, but a dedicated integration user is easier to revoke later.

  1. Sign in to WordPress admin.
  2. Open Users > Add New if you want a dedicated user.
  3. Create a user named something clear, such as pageoptimized.
  4. Give the user a role that can create posts.
  5. Use Author, Editor, or Administrator depending on your publishing policy.
  6. Save the user.

Step 2: create an application password

  1. In WordPress admin, open Users.
  2. Open the user that PageOptimized will use.
  3. Scroll to Application Passwords.
  4. Enter an application name, such as PageOptimized.
  5. Click Add New Application Password.
  6. Copy the generated password immediately.
  7. Keep the spaces if WordPress shows spaces; PageOptimized can send it as the password value.
  8. Store it somewhere secure until you paste it into PageOptimized.

Step 3: confirm the REST API URL

  1. Open a browser tab.
  2. Visit your site URL followed by /wp-json/.
  3. Example: https://example.com/wp-json/.
  4. Confirm you see a JSON response instead of a blocked page, login screen, or firewall challenge.
  5. If you see a security challenge, allow PageOptimized or REST API requests before connecting.

Step 4: save in PageOptimized

  1. Return to PageOptimized.
  2. Enter the site URL, such as https://example.com.
  3. Enter the WordPress username for the publishing user.
  4. Paste the application password.
  5. Leave Require approval on if drafts should need approval before Xavier creates them.
  6. Click Save WordPress.
  7. PageOptimized checks /wp-json/wp/v2/users/me?context=edit with those credentials.
  8. When the save succeeds, click Create draft.
  9. Open WordPress Posts > All Posts.
  10. Confirm the test draft exists.

What PageOptimized sends when creating a draft

  1. Title goes to the WordPress post title.
  2. Slug goes to the WordPress post slug.
  3. Content goes to the WordPress post content.
  4. Meta description goes to the excerpt.
  5. Status is draft, not publish.

Troubleshooting

  1. If WordPress returns 401, check the username and application password.
  2. If WordPress returns 403, confirm the user role can create posts.
  3. If the REST API URL is blocked, check security plugins, hosting firewall rules, and CDN bot protection.
  4. If the site redirects between www and non-www, paste the final canonical HTTPS site URL.
  5. If Save WordPress works but Create draft fails, check whether a plugin restricts post creation through REST API.
  6. Check the Audit Logs tab in PageOptimized for the exact HTTP response.