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

# Connect your app to WordPress (self-hosted)

> Connect your app to a self-hosted WordPress site to read and manage posts, pages, media, and users through the WordPress REST API.

export const connector_0 = "WordPress (self-hosted)"

[WordPress](https://wordpress.org/) is open-source CMS software you host on your own domain or server. The **WordPress (self-hosted)** connector lets your Lovable app read and manage posts, pages, media, and users on that site through the WordPress REST API. It's designed for headless CMS apps, editorial dashboards, and content workflows backed by a WordPress install you control.

With WordPress (self-hosted), your app can:

* List and display posts, pages, and custom post types
* Upload and manage media library assets
* Read site settings, categories, tags, and user profiles
* Build headless CMS experiences on self-hosted WordPress

<Warning>
  This connector is for **self-hosted WordPress** sites. For **WordPress.com** hosted sites, use the [WordPress.com](/integrations/wordpress-com) connector instead.
</Warning>

## Common use cases and example apps

| Example app                     | Example prompt                                                                                                                                     | Description                                                                                                                                                                              |
| :------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Marketing and landing pages** | *Use WordPress (self-hosted) and build a marketing site where the homepage and key sections load titles, body, and images from my WordPress site.* | **Ship pages powered by CMS content.**<br />The app fetches posts or pages from WordPress and renders them as components so editors can update copy and media without changing app code. |
| **Blog and editorial sites**    | *Use WordPress (self-hosted) and build a blog that lists recent posts and shows each post's content, featured image, and excerpt.*                 | **Run a blog backed by WordPress.**<br />The app loads post lists and detail views from the API and reflects new publishes from the WordPress dashboard.                                 |
| **Resource or help center**     | *Use WordPress (self-hosted) and build a help center where each article is a WordPress page with search and categories.*                           | **Centralize articles in WordPress.**<br />The app queries pages or posts and builds navigation and article views from your CMS structure.                                               |
| **Media library browser**       | *Use WordPress (self-hosted) and build an admin page that lists media from my WordPress library with search and upload.*                           | **Manage media from a custom interface.**<br />The app reads and uploads media through the WordPress REST API based on the connected user's permissions.                                 |
| **Editorial publish workflow**  | *Use WordPress (self-hosted) and build a form that creates a draft post on my WordPress site when someone submits it.*                             | **Turn submissions into drafts.**<br />The app creates or updates content through the API so editors finish work in WordPress.                                                           |
| **Content dashboard**           | *Use WordPress (self-hosted) and build a dashboard that shows recent posts, categories, and tags from my site.*                                    | **Give operators a focused view of site content.**<br />The app reads posts, categories, and tags and presents them in one place outside the WordPress admin.                            |

## How to connect WordPress (self-hosted)

Workspace **admins** and **owners** can connect WordPress (self-hosted).

You can create multiple WordPress connections using different sites or Application Passwords, which is useful for separating environments (for example, staging and production) or connecting multiple self-hosted sites.

When the connection is created, WordPress (self-hosted) becomes available across all projects in the workspace. Anyone building in a project can ask Lovable in chat to link their project to it.

### Prerequisites

Before connecting WordPress (self-hosted), make sure you have:

* A self-hosted WordPress site with HTTPS enabled
* WordPress 5.6 or later (Application Passwords require this version)
* Non-plain WordPress permalinks enabled for REST API routes
* A WordPress user account with the permissions your app needs
* A WordPress Application Password for that user
* Lovable workspace **owner** or **admin** role

<Note>
  All API requests made through this connector run against your WordPress site. Hosting, plugins, and site-related costs are handled outside Lovable.
</Note>

### Step 1: Get a WordPress Application Password

A **WordPress Application Password** lets your Lovable app authenticate with the WordPress REST API using HTTP Basic auth. The connected WordPress user's role controls what the connection can read or change.

To create a WordPress Application Password:

<Steps>
  <Step title="Open your WordPress admin dashboard">
    Sign in to the WordPress admin for the site you want to connect.
  </Step>

  <Step title="Open the user profile">
    Go to **Users → Profile** if you are creating a password for your own account. To create a password for another user, go to **Users → All Users**, open that user, and edit their profile.
  </Step>

  <Step title="Create an Application Password">
    Scroll to **Application Passwords**. Enter a name for the application, for example `Lovable integration`, then click **Add New Application Password**.
  </Step>

  <Step title="Copy the password">
    Copy the generated password and store it securely. WordPress shows it once. You can paste it with or without spaces.
  </Step>

  <Step title="Note your site URL and username">
    Note the HTTPS URL of your WordPress site (for example, `https://blog.example.com`) and the WordPress username for the account you used.
  </Step>
</Steps>

<Warning>
  Your Application Password functions like a password. Keep it secure and never share it publicly. You'll need it in the next step.
</Warning>

See WordPress documentation for more: [Application Passwords](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/) and the [WordPress REST API handbook](https://developer.wordpress.org/rest-api/).

### Step 2: Connect WordPress (self-hosted) to Lovable

You can create multiple connections using different sites or Application Passwords.

<Steps>
  <Step title="Open WordPress (self-hosted) in Connectors">
    Go to **Connectors → App connectors** and select **WordPress (self-hosted)**.
  </Step>

  <Step title="Add a connection">
    Click **Add connection**.
  </Step>

  <Step title="Configure the connection">
    1. **Display name**: name the connection, for example `WordPress Prod`.
    2. **Site URL**: enter the HTTPS URL of your WordPress site, for example `https://blog.example.com`. You can enter the site root or a REST discovery URL such as `https://blog.example.com/wp-json`.
    3. **Username**: enter the WordPress username for the Application Password.
    4. **Application password**: paste the Application Password you generated in WordPress.
  </Step>

  <Step title="Choose who can access this connection">
    Under **Who can access this connection**, decide who in your workspace can use the connection:

    * **Only you** (default): only the person creating the connection can use it and its associated data.
    * **Invite specific people**: only you and explicitly added workspace members can use the connection and its associated data.
    * **Invite entire workspace**: click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.

    See [Connection-level access](/integrations/introduction#connection-level-access) for more information.
  </Step>

  <Step title="Connect">
    Click **Connect**.
  </Step>
</Steps>

When connected, anyone building in a project can ask Lovable in chat to link their project to WordPress (self-hosted) (based on configured connection-level access). Your Lovable apps can then read and manage WordPress content based on the connected user's permissions.

## Working with WordPress permalinks and REST API routes

WordPress REST API routes require permalinks that are not set to **Plain**. If verification fails with a route error such as `rest_no_route`, check that pretty permalinks are enabled under **Settings → Permalinks** in WordPress admin.

Lovable accepts your site root URL or a REST discovery URL and connects to the WordPress REST API v2 path (`/wp-json/wp/v2`). Your site must use HTTPS in the **Site URL** field.

The connector verifies credentials by calling the WordPress `users/me` endpoint. If verification fails, confirm the username and Application Password match, the user still exists, and the password has not been revoked in WordPress.

## Limitations

The WordPress (self-hosted) connector cannot:

* Connect to **WordPress.com** hosted sites. Use the [WordPress.com](/integrations/wordpress-com) connector for those sites.
* Create Application Passwords or change WordPress user roles for you. Configure these in WordPress admin first.
* Bypass the permissions of the connected WordPress user account.
* Configure WordPress permalinks, hosting, SSL, plugins, or site settings for you.
* Call WooCommerce store APIs. Use the [WooCommerce](/integrations/woocommerce) connector for store operations.
* Refresh or rotate Application Passwords automatically. To rotate credentials, create a new Application Password in WordPress and update the Lovable connection.
* Support per-end-user WordPress login. Each connection represents a single WordPress account shared across all projects linked to it.

If an Application Password is revoked in WordPress, update or recreate the connection in Lovable before API calls can succeed again.

## How to unlink projects from a {connector_0} connection

Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects.

To unlink projects:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to manage.
  </Step>

  <Step title="Select projects">
    Under **Linked projects**, check the projects you want to unlink.
  </Step>

  <Step title="Confirm">
    Click **Unlink projects** and confirm.
  </Step>
</Steps>

When unlinked, those projects will no longer have access to {connector_0} through this connection. If a project needs {connector_0} again, you can link it to any available connection.

## How to delete a {connector_0} connection

Workspace admins and owners can delete {connector_0} connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it.

<Warning>
  Deleting a connection is permanent and cannot be undone. It will remove the credentials from all linked projects, and any apps using this connection will stop working until a new connection is added.
</Warning>

Before deleting, review the **Linked projects** section to see which projects are currently using the connection.

To delete a connection:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to remove.
  </Step>

  <Step title="Review linked projects">
    Review the **Linked projects** section.
  </Step>

  <Step title="Delete">
    Under **Delete this connection**, click **Delete** and confirm.
  </Step>
</Steps>
