# WordPress

WordPress is a popular open-source content management system (CMS) that allows users to create and manage websites easily. It offers customizable themes, plugins, and a user-friendly interface, making it ideal for blogs, business websites, and eCommerce stores. Powering over 40% of websites worldwide, WordPress is known for its flexibility, scalability, and SEO-friendly features.

### **How to Integrate WordPress with ZBrain Flow** <a href="#how-to-integrate-wordpress-with-zbrain-flow" id="how-to-integrate-wordpress-with-zbrain-flow"></a>

Integrating WordPress with ZBrain Flow streamlines content publishing and website management by automating tasks such as post creation and updates. Follow these steps to set up the integration:

1. **Open ZBrain Flow** – Navigate to the ZBrain Flow platform.
2. **Click the ‘+’ Button** – Initiate a new integration setup.
3. **Search for WordPress** – Type "WordPress" in the search bar and select it from the available options.
4. **Choose an Action** – Select the specific action you want to automate, such as creating, updating, or retrieving post details.

### **How to Connect WordPress to ZBrain Flow** <a href="#how-to-connect-wordpress-to-zbrain-flow" id="how-to-connect-wordpress-to-zbrain-flow"></a>

To establish a connection between WordPress and ZBrain Flow, follow these steps:

**1. Provide a Connection Name**

Assign a recognizable name to identify the connection for future use.

**2. Enter API Credentials**

You will need to enter the following credentials to authenticate the connection:

* **Username**
  * **Login to WordPress Admin Dashboard**: Visit `yourwebsite.com/wp-admin`.
  * **Navigate to Users**: In the left-hand menu, go to the "Users" section.
  * **Find Your Username**: Your username will be listed in the user list. If multiple users exist, locate the correct one.
* **Password**
  * Enter your existing WordPress password.
  * **Reset Password (if needed)**:
    * Go to the login page and click ‘Lost your password?’
    * Enter your username or email address.
    * Check your email for a password reset link and follow the instructions to create a new password.
* **Website URL**
  * **Check General Settings**: In the WordPress admin dashboard, go to Settings > General.
  * **Find Your URL**: Your website URL is listed under "WordPress Address (URL)" and "Site Address (URL)".

**3. Click Save**

Once all details are entered, click ‘Save’ to finalize and authenticate the connection.

### **Actions Available in WordPress Integration** <a href="#actions-available-in-wordpress-integration" id="actions-available-in-wordpress-integration"></a>

Below are the available actions you can perform through this integration.

#### **1. Create Post** <a href="#id-1.-create-post" id="id-1.-create-post"></a>

Automate the process of publishing blog posts on WordPress. This action streamlines content creation by allowing users to define the post structure and metadata.

**Steps to Create a Post:**

* **Select an Existing Connection or Create a New One** – Choose an already configured WordPress connection or establish a new one.
* **Enter the Post Title** – Provide a title for the blog post.
* **Enter the Content** – Input the main content of the post using the WordPress Text Editor, which supports HTML formatting.
* **Enter the Slug** – Define a URL-friendly identifier for the post (e.g., "my-first-blog-post").
* **Enter the Publish Date** – Specify the exact date and time the post should be published.
* **Enter the Featured Media URL** – Provide the direct URL to an image or media file to be used as the post’s featured media.
* **Enter Tags** – Add relevant tags to categorize the post.
* **Enter Custom ACF Fields** – If using Advanced Custom Fields (ACF), input field names and values. ACF enhances post customization.
* **Select Categories** – Assign the post to one or more WordPress categories.
* **Select the Featured Media (Image)** – Choose an image to be displayed as the post’s thumbnail.
* **Select the Post Status** – Choose from Published, Scheduled, Draft, Pending, Private, or Trash.
* **Add an Excerpt** – Provide a short summary of the post.
* **Enable/Disable Additional Options:**
  * **Allow Comments** – Toggle whether comments are allowed.
  * **Open to Pinging** – Enable or disable pingbacks and trackbacks.

#### **2. Create Page** <a href="#id-2.-create-page" id="id-2.-create-page"></a>

This action allows users to create new pages on their WordPress site, such as About Us, Contact, or Landing Pages.

**Steps to Create a Page:**

* **Select an Existing Connection or Create a New One** – Choose an already configured WordPress connection or set up a new one.
* **Enter the Page Title** – Provide a name for the new page.
* **Enter the Content** – Add the page content using the WordPress Text Editor (supports HTML).
* **Enter the Slug** – Define a user-friendly URL for the page.
* **Enter the Publish Date** – Schedule when the page should be published.
* **Select the Page Status** – Choose between Published, Scheduled, Draft, Pending, Private, or Trash.
* **Add an Excerpt** – Include a brief summary of the page.
* **Enable/Disable Additional Options:**
  * **Allow Comments** – Decide if visitors can leave comments on the page.
  * **Open to Pinging** – Enable or disable pingbacks and trackbacks.

#### **3. Update Post** <a href="#id-3.-update-post" id="id-3.-update-post"></a>

This action allows for modifying an existing WordPress post, ensuring content remains accurate and up to date.

**Steps to Update a Post:**

* **Select an Existing Connection or Create a New One** – Use an existing WordPress connection or configure a new one.
* **Select the Post to be Updated** – Choose the specific post that needs modifications.
* **Enter the Updated Title** – Modify the post’s title if needed.
* **Enter the Updated Content** – Update the post’s text, images, or other content elements.
* **Enter the Slug** – Adjust the URL slug if necessary.
* **Enter the Updated Publish Date** – Change the publishing date if required.
* **Enter the Featured Media URL** – Provide a new featured media URL, if applicable.
* **Enter Updated Tags** – Modify or add new tags for better categorization.
* **Enter Custom ACF Fields** – Update ACF field values if applicable.
* **Select Updated Categories** – Change or add new categories for the post.
* **Select the Featured Media (Image)** – Update the featured image, if needed.
* **Select the Updated Status** – Change the status to Published, Scheduled, Draft, Pending, Private, or Trash.
* **Add an Updated Excerpt** – Modify the short description of the post.
* **Enable/Disable Additional Options:**
  * **Allow Comments** – Toggle comment settings.
  * **Open to Pinging** – Enable or disable pingbacks and trackbacks.

#### **4. Get Post Details** <a href="#id-4.-get-post-details" id="id-4.-get-post-details"></a>

Retrieve specific details of a WordPress post, including its title, content, status, publish date, categories, tags, and more.

**Steps to Get Post Details:**

* **Select an Existing Connection or Create a New One** – Use a previously set up WordPress connection or establish a new one.
* **Enter the Post ID** – Provide the unique identifier of the post whose details you want to retrieve.

#### **5. Custom API Call** <a href="#id-5.-custom-api-call" id="id-5.-custom-api-call"></a>

For users who require advanced functionality beyond the predefined actions, custom API calls allow for direct interaction with the WordPress REST API.

**Configuration Steps:**

* **Select an Existing Connection or Create a New One** – Choose an existing WordPress connection or set up a new one.
* **Select the HTTP Method** – Choose the request type that aligns with your API action:
  * **GET** – Retrieve details of a post, page, category, or media file.
  * **POST** – Create a new post, page, or media file.
  * **PATCH** – Modify metadata or update specific fields in a post or page.
  * **PUT** – Replace an entire post or page with new content.
  * **DELETE** – Permanently remove a post, page, or media file.
  * **HEAD** – Fetch response headers without retrieving full content.
* **Add Headers** – Define additional headers as required by the API request. Authorization headers are automatically injected. Click ‘+ Add Item’ to include more headers.
* **Add Query Parameters** – Customize API requests with specific filters or options. Click ‘+ Add Item’ to add more parameters.
* **Enter JSON Body** – Provide structured request data in JSON format.
* **Set Timeout (in Seconds)** – Define the request timeout duration to prevent long-running API calls from delaying.

**Note:** Click *'f'* to insert dynamic values for more flexible configurations.
