# WordPress Integration

> Part of the [NextBlog documentation](https://nextblog.ai/docs.md). Live page: [https://nextblog.ai/docs/integration-wordpress](https://nextblog.ai/docs/integration-wordpress)

Automatically publish approved blog posts directly to your WordPress site. This integration converts markdown to HTML, uploads featured images, and publishes posts with proper formatting.

#### Prerequisites

Before you begin, make sure you have:

- A WordPress site with admin access
- WordPress version 5.6 or higher (for Application Passwords support)
- Your WordPress site URL

### Step 1: Create Application Password in WordPress

WordPress Application Passwords are more secure than using your regular password. Follow these steps:

#### 1.1 Log into WordPress Admin

Log into your WordPress admin dashboard at `https://yoursite.com/wp-admin`

#### 1.2 Navigate to Profile

In the left sidebar, click on **"Users"** → **"Profile"**

#### 1.3 Find Application Passwords Section

Scroll down to the **"Application Passwords"** section (usually near the bottom of the page)

#### 1.4 Create New Application Password

1. In the "New Application Password Name" field, enter: `NextBlog Integration`
2. Click the **"Add New Application Password"** button
3. A new password will be generated and displayed **only once**
4. **Important:** Copy this password immediately and save it securely. You won't be able to see it again!

### Step 2: Configure WordPress Integration in NextBlog

#### 2.1 Navigate to Project Settings

1. Log into your NextBlog dashboard
2. Click on your project to open it
3. Click on **"Settings"** or navigate to the project settings page

#### 2.2 Enable WordPress Integration

1. Scroll down to the **"WordPress CMS Integration"** section
2. Toggle the **"Enable WordPress Integration"** switch to ON

#### 2.3 Enter WordPress Credentials

Fill in the following fields:

- **WordPress Site URL:** Enter your WordPress site URL (e.g., `https://yoursite.com` or `https://yoursite.wordpress.com`)
- **WordPress Username:** Enter your WordPress username (the one you use to log in)
- **WordPress Application Password:** Paste the Application Password you created in Step 1

**Note:** Do NOT use your regular WordPress password. Always use an Application Password for security.

#### 2.4 Test Connection

1. Click the **"Test Connection"** button
2. Wait for the test to complete
3. If successful, you'll see a green success message
4. If it fails, check your credentials and try again

#### 2.5 Save Changes

Click the **"Save Changes"** button at the bottom of the form to save your WordPress integration settings.

### How It Works

Once configured, here's what happens when you approve a blog post:

1. **Post Approval:** When you approve a blog post in NextBlog, the WordPress integration is automatically triggered
2. **Content Conversion:** The markdown content is automatically converted to HTML format
3. **Image Upload:** Featured images are automatically uploaded to your WordPress media library
4. **Post Creation:** A new WordPress post is created with:
  - Title from your NextBlog post
  - HTML content (converted from markdown)
  - Featured image
  - Excerpt/description
  - SEO-friendly slug
5. **Publishing:** The post is published to your WordPress site and is immediately live
6. **Tracking:** The WordPress post ID and URL are saved in NextBlog for future reference

### Troubleshooting

#### Connection Test Fails

**Possible causes:**

- Incorrect WordPress site URL - Make sure it includes `https://` and doesn't have a trailing slash
- Wrong username - Use the exact username you use to log into WordPress
- Invalid Application Password - Make sure you copied the entire password correctly
- WordPress version too old - Application Passwords require WordPress 5.6+
- Site is down or unreachable - Check if your WordPress site is accessible

#### Posts Not Publishing

**Check the following:**

- Make sure the integration is enabled in project settings
- Verify the connection test passes
- Check that you're approving posts (not just generating them)
- Look for error messages in your NextBlog dashboard
- Check WordPress admin for any failed post attempts

#### Images Not Uploading

**Common issues:**

- WordPress media library permissions - Make sure your user has permission to upload media
- Image URL accessibility - The image URL must be publicly accessible
- File size limits - Check WordPress upload size limits

### Next Steps

Now that your WordPress integration is set up:

- Generate or create a blog post in NextBlog
- Review and approve the post
- Check your WordPress site - the post should appear automatically!
- Consider setting up [Webhooks](/docs/integration-webhooks.md) for additional automation
