Complete documentation for installing, configuring, and extending AskWP.

Installation

AskWP requires WordPress 5.9 or later and PHP 7.4 or later. No other dependencies.

Method 1: Upload ZIP

  1. Download the askwp.zip file
  2. Go to your WordPress admin → Plugins → Add New → Upload Plugin
  3. Select the ZIP file and click Install Now
  4. Click Activate

Method 2: Manual Upload

  1. Extract the ZIP file
  2. Upload the askwp folder to /wp-content/plugins/
  3. Go to WordPress admin → Plugins and click Activate

Quick Start

  1. Go to Settings → AskWP
  2. On the LLM Provider tab, select your provider (OpenAI, Anthropic, OpenRouter, or Ollama)
  3. Enter your API key (or Ollama endpoint)
  4. Choose a model
  5. On the System Prompt tab, write instructions for your chatbot
  6. Click Save Changes
  7. Visit your site — the chat widget appears in the bottom-right corner

Admin Panel Tabs

1. General

Enable or disable the widget, set the bot’s display name, choose a default language, and select the widget position (bottom-right or bottom-left).

2. LLM Provider

Select your AI provider (OpenAI, Anthropic, OpenRouter, or Ollama), enter credentials, choose a model, and configure generation parameters like max output tokens and temperature.

3. System Prompt

Write the system instructions that define your chatbot’s personality and behavior. Use {bot_name} as a placeholder that gets replaced with the bot name from the General tab.

This tab also includes a Context Pack field (for static information you want available on every turn) and an FAQ field (question-answer pairs in Q: / A: format).

4. RAG

Configure the retrieval-augmented generation system: enable/disable RAG, set the maximum number of search results and FAQ matches, choose which post types to search, and set the snippet length. When using a provider with tool support (OpenAI, Anthropic, OpenRouter), agentic search is used automatically — the AI browses your site via tools instead of relying on keyword matching alone.

5. Form Builder

Enable the built-in contact form, set the form title and trigger button label, configure the recipient email address, subject line template, and success message. Use the field editor to add, remove, reorder, and configure form fields. The AI can trigger the form inside the chat, but form data is never shared with the AI — submissions go directly to your email.

6. Appearance

Customize colors (primary, secondary, text), choose an icon preset or upload a custom icon, upload a bot avatar, set border radius, font family, widget width, z-index, and add custom CSS.

7. Rate Limits

Set the maximum number of chat messages per hour and form submissions per day. These limits are enforced per IP address using WordPress transients.

REST API

Chat Endpoint

POST /wp-json/askwp/v1/chat

Request body:

  • messages — Array of message objects with role (user/assistant) and content
  • page_url — Current page URL (optional, used for context)
  • page_title — Current page title (optional, used for context)

Response:

  • reply — The assistant’s response text
  • sources — Array of source URLs the AI read to answer
  • action — Optional action indicator (e.g., form_trigger)
  • usage — Token usage stats (input_tokens, output_tokens)

Form Endpoint

POST /wp-json/askwp/v1/submit_form

Request body: key-value pairs matching the configured form fields.

Response: { success: true } or error details.

Hooks and Filters

AskWP provides several WordPress filters for developers who want to extend or modify behavior:

  • askwp_system_prompt — Filter the assembled system prompt before it’s sent to the LLM
  • askwp_rag_context — Filter the RAG context text
  • askwp_chat_response — Filter the final response before it’s returned to the client
  • askwp_form_email_body — Filter the email body before sending