Documentation

Getting Started

Install Paca AI from the WordPress Plugins Marketplace.

After activating the plugin, navigate to the plugin settings page and connect your AI API key to begin using AI features.

AI Streaming is an optional add-on that enables real-time streaming responses for AI Search, excerpt generation, and content writing. It is purchased separately and activated via a license key in the plugin settings.

AI API Keys

Get Google Gemini API Key

Get OpenAI API Key

AI Content Assistant

Enable Assistant for Post Types

Enable AI features for all post types, or select specific types as needed.

This feature is optional; "post" is selected by default.

Excerpt Character Limit

Set the maximum character count for AI-generated excerpts.

Default: 300 characters.

Excerpt Generation Prompt

Create a custom prompt to be used when generating excerpts.

In the backend, the prompt will be combined with the post content.

Use Post Meta

Allow the AI to utilize custom fields attached to posts for improved results.

Custom Image Prompt

Create a custom prompt to be used when generating images.

In the backend, the prompt will be combined with the post content as thematic inspiration.

This feature is available only when OpenAI models are enabled.

AI Training

Allow AI to Learn About Site

When enabled, AI will periodically analyze your site's content and generate a knowledge base summary.

This summary is used to give AI Search and the assistant context about who you are and what your site covers.

AI Training Frequency

Select how often AI should re-analyze your site and update the summary.

Available intervals: Daily, Weekly, Monthly, Quarterly, Biannually, Yearly.

Default: Biannually.

Number of Posts for AI Training

How many posts per post type the AI will read during each training run.

Default: 5.

Post Types for AI Training

Select which post types are included in AI Training.

All public post types are selected by default.

AI-Generated Site Summary

The AI-generated summary of your site, built from the most recent training run.

This field is editable — you can review and adjust what the AI learned about your site (up to 500 characters).

The summary is injected into AI Search prompts to give the assistant background context.

AI Search Type

Choose how AI Search responds to visitor queries.

Search: finds and returns relevant articles and pages from your site.

Assistant: delivers AI-generated answers based on your site content, similar to a chatbot.

AI Search Frequency

Select how often AI Search re-analyzes your site's content and recalibrates search rankings in the background.

Available intervals: Daily, Weekly, Monthly, Quarterly, Biannually, Yearly.

Default: Biannually.

AI Search Post Types

Select which post types to include in AI Search indexing, and set a post limit per type.

Default: all public post types, 100 posts each.

Each post consumes at minimum 1 API request during indexing.

AI Search Custom Prompt

Add a custom prompt to guide how AI Search ranks and presents results.

Maximum 500 characters.

Using the Gutenberg Block

Add the Paca AI Search block (paca/ai-search) to any page or post via the block editor.

The block includes the following settings in the sidebar:

  • Results Per Page — number of results shown per batch (default: 4)
  • Max Results — maximum total results returned (default: 12)
  • Display Answer — show an AI-generated answer above results (default: on)
  • Display Results — show article result cards below the answer (default: off)
  • Placeholder — custom placeholder text for the search input
  • Lazy Load — automatically load more results as the user scrolls (default: off)

Using the Shortcode

Add [paca_ai_search] anywhere in your post or page content.

Available attributes:

  • results_per_page — results per batch (default: 4)
  • max_results — maximum total results (default: 12)
  • display_answer — show AI answer, 1 or 0 (default: 1)
  • display_results — show result cards, 1 or 0 (default: 0)
  • placeholder — custom placeholder text
  • lazy_load — auto-load on scroll, 1 or 0 (default: 0)
  • results_template — ID of the wp.template to use for result cards (default: paca-ai-search-result)
  • answer_template — ID of the wp.template to use for the AI answer (default: paca-ai-search-answer-result)

Example: [paca_ai_search display_answer="1" display_results="1" results_per_page="6" results_template="my-search-result" answer_template="my-search-answer"]

Custom Result Template

By default, AI Search renders results using a built-in card template. You can replace it with your own from your theme's functions.php.

Step 1 — Register your template in the footer:

add_action( 'wp_footer', function () { ?>

<script type="text/html" id="tmpl-my-search-result">

  <# console.log(data); #>

  <article><a href="{{ data.permalink }}">{{ data.post_title }}</a></article>

</script>

<?php } );

Use {{ data.field }} for escaped output, {{{ data.field }}} for raw HTML, and <# if (condition) { #> for logic.

Add <# console.log(data); #> inside the template to inspect all available fields in your browser console.

Step 2 — Pass the template ID to the shortcode:

[paca_ai_search results_template="my-search-result"]

Available data fields by default: post_title, permalink, post_excerpt, thumbnail_url, categories (array), post_author, post_date, score.

Adding custom fields — Use the paca_ai_search_result_item filter in your functions.php to add any additional data to each result:

add_filter( 'paca_ai_search_result_item', function( $item, $post ) {

    $item['reading_time'] = get_post_meta( $post->ID, '_reading_time', true );

    return $item;

}, 10, 2 );

The field will then be available in your template as {{ data.reading_time }}.

Custom Answer Template

The AI-generated answer box uses a separate template. Override it the same way as the result template.

Step 1 — Register your answer template in the footer:

add_action( 'wp_footer', function () { ?>

<script type="text/html" id="tmpl-my-search-answer">

  <div class="my-answer">{{{ data.answer }}}</div>

</script>

<?php } );

Use {{{ data.answer }}} (triple braces) since the answer contains HTML.

Step 2 — Pass the template ID to the shortcode:

[paca_ai_search answer_template="my-search-answer"]

Frontend Widget Settings

Frontend Widget Selector for Main Content

Specify a selector for the main content area from which the AI will extract content.

The default selectors are: main, article, [role="main"], .entry-content, .post-content, .content, #content, .main, or #main

If your page's main content does not reside within the default HTML elements, you can specify a custom selector for the AI to use.

For example: .my-main-content or #my-main-content

Frontend Widget Selector for Summary Content

Specify a selector where the AI will place the generated summary content.

By default, a modal window will appear.

To use a custom area, add a selector where the AI should attach the generated summary.

For example: .my-summary or #my-summary

Frontend Widget Cooldown

Set the cooldown period (in seconds) before another AI request can be made.

By default, the cooldown is 10 minutes before another request can be made.

Decreasing this limit may significantly increase the cost per visitor.

The summary is cached in localStorage for 24 hours, so users will see the same summary during that period.

For private browsing, the summary is cached in memory; however, refreshing the page will clear it.

The cooldown helps prevent request abuse and keeps your costs lower.

Summary Character Limit

Set the maximum character count for the AI-generated summary in the frontend widget.

Default: 400.

Frontend Widget Custom Prompt

Customize the prompt used when generating the frontend widget summary.

Maximum 500 characters.

Setting Up Frontend Widget

Using class name

Add the .paca-summary-trigger class to an HTML element.

When this element is clicked, the AI will generate a summary based on the page content and display it in a modal window, or attach it to a Frontend Widget Selector for Summary Content if specified in the settings.

Example: <button class='paca-summary-trigger'>Summarize Page</button>

Using shortcode

Add [paca_summary_button text='My Button' class='my-button'] shortcode anywhere in your post editor.

Optional: text attribute allows you to customize the button text, and class attribute lets you add custom classes for styling.

Available Filters

paca_summarize_max_requests

Allows developers to customize the maximum number of summary requests a user can make within a defined time window.

This helps prevent AI API abuse when using frontend widget, especially in private browsing.

Example: add_filter( 'paca_summarize_max_requests', 5 );

Default: 5 requests.

paca_summarize_time_window

Lets developers set the duration (in seconds) for the rate-limiting window during which the request count is tracked.

This helps prevent AI API abuse when using frontend widget, especially in private browsing.

Example: add_filter( 'paca_summarize_time_window', 15 * MINUTE_IN_SECONDS );

Default: 15 minutes.

paca_content_assistant_image_size

Override the image size used when generating images via DALL-E in the content assistant.

Available values: 1024x1024, 1024x1792, 1792x1024.

Example: add_filter( 'paca_content_assistant_image_size', '1792x1024' );

Default: 1024x1024.

paca_ai_search_result_item

Modify individual search result data before it is returned in the JSON response.

Receives the result item array and the WP_Post object. Return the modified item.

Available fields: ID, post_title, post_excerpt, permalink, thumbnail_url, categories, post_author, post_date, score.

Example:

add_filter( 'paca_ai_search_result_item', function( $item, $post ) {

    $item['reading_time'] = get_post_meta( $post->ID, '_reading_time', true );

    return $item;

}, 10, 2 );