> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skayle.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# WordPress Setup

> Connect WordPress with Application Password auth and publish Skayle posts to your WP site.

## 1. Overview

WordPress connector publishes Skayle posts to WordPress using the WordPress REST API.

It uses:

* `siteUrl`
* `username`
* `applicationPassword`

Connection testing validates credentials via the WordPress `/users/me` endpoint.

## 2. Prerequisites

Before connecting:

* A WordPress site with REST API enabled (`/wp-json/wp/v2` reachable)
* A WordPress user account for Skayle publishing
* Ability to create an Application Password for that user

## 3. Creating API credentials

In WordPress:

1. Go to `Users -> Profile`.
2. Find `Application Passwords`.
3. Create a new application password for Skayle.
4. Copy the generated password.

In Skayle connector settings, enter:

* Site URL (for example `https://example.com`)
* Username
* Application Password

## 4. Required permissions

Your WordPress user should have permissions to:

* Read users (`/users/me` test)
* Create and update posts
* Manage categories and tags (if syncing taxonomies to WordPress)

Editor or Administrator role is typically used.

## 5. CMS-side setup

Required in WordPress:

* Standard Posts enabled
* Categories and Tags enabled
* Author users present (for author sync from WordPress)

No webhook setup is required.

## 6. Connecting in Skayle

1. Open `Settings -> Connector`.
2. Select `WordPress`.
3. Enter `Site URL`, `Username`, `Application Password`.
4. Run `Test Connection`.
5. Save connector.

Optional workflow steps:

* Sync categories/tags/authors from WordPress to Skayle
* Configure taxonomy source of truth

## 7. Field mapping explanation

WordPress connector uses fixed WordPress fields:

| Skayle field   | WordPress field                                |
| -------------- | ---------------------------------------------- |
| Title          | `title`                                        |
| Slug           | `slug`                                         |
| Excerpt        | `excerpt`                                      |
| Content        | `content`                                      |
| Featured image | Media library + `featured_media`               |
| Status         | `publish` for published, `draft` for draft     |
| Categories     | `categories` (mapped IDs)                      |
| Tags           | `tags` (mapped IDs)                            |
| Author         | `author` (mapped WP user ID or default author) |

Taxonomy behavior:

* Categories: sync both directions
* Tags: sync both directions
* Authors: sync from WordPress to Skayle
* Author sync to WordPress users: not implemented

## 8. Publishing test article

1. Create or open a draft post in Skayle.
2. Assign category/tag/author.
3. Publish the post.
4. Confirm it appears in WordPress Posts list.
5. Open the live URL from Skayle publish result.

## 9. Common errors & troubleshooting

| Issue                              | Likely cause                     | Fix                                                        |
| ---------------------------------- | -------------------------------- | ---------------------------------------------------------- |
| Connection test fails              | Wrong URL/username/password      | Re-enter credentials and verify Application Password       |
| 401/403 from WP API                | User lacks capability            | Use an Editor/Admin account or adjust role permissions     |
| Missing categories/tags on publish | Taxonomy mappings missing/stale  | Re-sync taxonomies and republish                           |
| Author not assigned as expected    | No author mapping/default author | Sync authors from WP and set a default author if needed    |
| Featured image missing             | Media upload failed              | Retry with reachable image URL and valid media permissions |

## 10. Best practices

* Use a dedicated WordPress user for Skayle publishing.
* Sync taxonomies before first bulk publish.
* Keep permalink and slug policies consistent across teams.
* Use drafts for review and move to publish only when final.
