WP Manifestindependent plugin directory
manifest / multisite / extrachill-search

ExtraChill Search

WordPress multisite search functionality for the Extra Chill network.

by Chris Huber · github.com/extra-chill/extrachill-search · website

0stars
17release downloads
0forks

Install

The author publishes release zips, so WP-CLI can install straight from GitHub:

wp plugin install https://github.com/extra-chill/extrachill-search/releases/download/v0.3.6/extrachill-search.zip

Readme

ExtraChill Search

Network-activated WordPress plugin providing universal multisite search functionality for the Extra Chill Platform. Searches across all sites in a WordPress multisite network and displays unified results.

Features

  • Universal Multisite Search - Search all network sites or specific sites with a single function call
  • Per-Site Scope (default) - Front-end searches default to the current site; a "This site / Entire network" toggle lets users opt into network-wide results
  • Canonical Site Map - Sites resolved from ec_get_domain_map() (extrachill-multisite), not get_sites() discovery
  • Flexible Post Type Support - Searches all public post types (posts, pages, custom post types, bbPress topics/replies)
  • Advanced Filtering - Full WP_Query parameter support including meta queries
  • Relevance Scoring - Weighted algorithm prioritizing exact matches, phrase matches, and word-level matching
  • Contextual Excerpts - Generates search-term-centered excerpts with highlighted matches
  • Cross-Site Pagination - Results sorted chronologically across all sites with 404 fix for paginated queries
  • Pagination 404 Fix - Automatically resolves WordPress 404 errors on paginated search across network sites
  • Site Badges - Visual indicators showing which site each result originates from

Requirements

  • WordPress: 5.0+
  • PHP: 7.4+
  • Multisite: WordPress multisite installation required
  • Theme: ExtraChill theme (for template integration)

Build + deployment

Build the production ZIP with ./build.sh (symlinked to /.github/build.sh).

Deployments and remote operations run through Homeboy (homeboy/ in this repo).

The build artifact is build/extrachill-search.zip.

Usage

Search All Sites

// Basic search
$results = extrachill_multisite_search( 'search term' );

// Search returns array of post objects with site metadata
foreach ( $results as $result ) {
    echo $result['post_title'];      // Post title
    echo $result['site_name'];       // Site name
    echo $result['permalink'];       // Full URL to post
}

Search Specific Sites

$results = extrachill_multisite_search(
    'search term',
    array( 'community.extrachill.com', 'extrachill.com' )
);

Advanced Search with Filters

$results = extrachill_multisite_search(
    'search term',
    array(),  // Empty array = all sites
    array(
        'limit'       => 20,
        'offset'      => 0,
        'post_status' => array( 'publish' ),
        'orderby'     => 'date',
        'order'       => 'DESC',
        'meta_query'  => array(
            array(
                'key'     => '_bbp_forum_id',
                'value'   => '1494',
                'compare' => '!=',
            ),
        ),
    )
);

Template Functions

// Get paginated search results with total count
list( $results, $total ) = extrachill_get_search_results( $_GET['s'], $page, $per_page );

// Generate pagination UI
extrachill_search_pagination( $total, $per_page, $page, $_GET['s'] );

// Get contextual excerpt with search term highlighted
$excerpt = ec_get_contextual_excerpt_multisite( $post_content, $search_term, 300 );

Architecture

Network Sites Covered

The plugin searches across all sites in your WordPress multisite network. In the Extra Chill Platform, this includes all 10 active sites:

  1. extrachill.com - Main site (Blog ID 1)
  2. community.extrachill.com - Forums (Blog ID 2)
  3. shop.extrachill.com - E-commerce (Blog ID 3)
  4. artist.extrachill.com - Artist platform (Blog ID 4)
  5. events.extrachill.com - Events calendar (Blog ID 7)
  6. newsletter.extrachill.com - Newsletter (Blog ID 9)
  7. docs.extrachill.com - Documentation (Blog ID 10)
  8. wire.extrachill.com - News wire (Blog ID 11)
  9. studio.extrachill.com - Studio / team workspace (Blog ID 12)

(Blog ID 8 / stream.extrachill.com was decommissioned in April 2026.)

Search Result Structure

array(
    'ID'           => 123,                    // Post ID
    'post_title'   => 'Post Title',           // Post title
    'post_content' => 'Full content...',      // Full content
    'post_excerpt' => 'Excerpt...',           // Excerpt
    'post_date'    => '2025-10-07 12:00:00',  // Publication date
    'post_type'    => 'post',                 // Post type
    'post_name'    => 'post-slug',            // Post slug
    'post_author'  => 1,                      // Author ID
    'site_id'      => 1,                      // Blog ID
    'site_name'    => 'Extra Chill',          // Site name
    'site_url'     => 'extrachill.com',       // Site URL
    'permalink'    => 'https://...',          // Full post URL
    'taxonomies'   => array(                  // Taxonomy terms
        'category' => array( 'term_name' => term_id ),
    ),
)

Performance Optimizations

  • Static Caching - Network sites cached in memory
  • WordPress Blog-ID-Cache - Automatic blog ID caching for optimal performance
  • Efficient Blog Switching - Minimal context switching with proper error handling
  • Relevance Scoring - Weighted algorithm sorts results by match quality before pagination
  • Cross-Site Date Sorting - Results sorted chronologically across all sites

Pagination Architecture

WordPress native search only checks the current site for results. When paginating multisite search results, if the current site has no matching posts on a given page, WordPress returns 404 even though other network sites may have results.

The plugin intercepts these 404 errors via the template_redirect hook, queries all network sites to verify results exist, and overrides the 404 status when multisite results are found. This ensures pagination works correctly across all network sites.

Theme Integration

Required Theme Functions

The plugin expects your theme to provide:

  • extrachill_breadcrumbs() - Breadcrumb navigation
  • extrachill_no_results() - No results message
  • extrachill_display_taxonomy_badges() - Taxonomy badge display
  • inc/archives/post-card.php - Post card template

Action Hooks Used

  • extrachill_before_body_content - Before main content area
  • extrachill_after_body_content - After main content area
  • extrachill_search_header - Search results header area
  • extrachill_archive_below_description - Below archive description
  • extrachill_archive_above_posts - Above posts loop

Template Override Filter

The plugin uses the ExtraChill theme's template routing filter:

add_filter( 'extrachill_template_search', array( $this, 'override_search_template' ), 10 );

This integrates with the theme's universal template routing system located in inc/core/template-router.php.

File Structure

extrachill-search/
├── extrachill-search.php           # Main plugin file
├── inc/
│   ├── core/
│   │   ├── search-functions.php    # Core multisite search functionality
│   │   └── taxonomy-functions.php  # Taxonomy helpers
│   └── templates/
│       ├── template-functions.php  # Template helper functions
│       └── site-badge.php          # Site badge display component
├── templates/
│   └── search.php                  # Search results template
├── build.sh                        # Production build script
├── .buildignore                    # Build exclusions
├── CLAUDE.md                       # Developer documentation
└── README.md                       # This file

Development

Build Production Package

# Create production ZIP file
./build.sh

# Output: Only /build/extrachill-search.zip file

Development Commands

# Check PHP syntax
php -l extrachill-search.php

# Test search function (requires WordPress environment)
wp eval 'print_r(extrachill_multisite_search("test"));'

Support

Author

Chris Huber

License

GPL v2 or later

Read the full README on GitHub →

Releases

TagPublishedAssetDownloads
v0.3.6 Aug 23, 2026 extrachill-search.zip 2
v0.3.5 Aug 23, 2026 extrachill-search.zip 2
v0.3.4 Aug 23, 2026 extrachill-search.zip 2
v0.3.3 Jul 12, 2026 01-extrachill-search.zip 7
v0.3.3 Jul 12, 2026 extrachill-search.zip 0
v0.3.2 Jun 22, 2026 extrachill-search.zip 1
v0.3.1 Jun 15, 2026 extrachill-search.zip 1
v0.3.0 Jun 3, 2026 extrachill-search.zip 2