PHPackages                             masonitedoors/searchwp-api-route - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. masonitedoors/searchwp-api-route

ActiveWordpress-plugin

masonitedoors/searchwp-api-route
================================

Adds an endpoint to the WordPress REST API for searching via SearchWP.

1.2.0(6y ago)0979gplv2+PHP

Since Jun 25Pushed 6y agoCompare

[ Source](https://github.com/masonitedoors/searchwp-api-route)[ Packagist](https://packagist.org/packages/masonitedoors/searchwp-api-route)[ RSS](/packages/masonitedoors-searchwp-api-route/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (7)Used By (0)

[![Banner](https://camo.githubusercontent.com/a146c109add8582e05d0a11f14b7941c0f64c3ffde2285663cacc7fa67940d8c/68747470733a2f2f63616c6465726177702e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30362f57504f52475f53656172636857502e706e67)](https://camo.githubusercontent.com/a146c109add8582e05d0a11f14b7941c0f64c3ffde2285663cacc7fa67940d8c/68747470733a2f2f63616c6465726177702e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30362f57504f52475f53656172636857502e706e67)

SearchWP API
============

[](#searchwp-api)

Adds an endpoint to the WordPress REST API for searching via [SearchWP](https://searchwp.com/?ref=121) -- the best tool for improving the usefulness and performance of WordPress search.

This plugin is a free plugin by [CalderaWP](https://CalderaWP.com). It is not an official add-on for SearchWP and is no way associated with SearchWP or the National Football League.

- Requires WordPress REST API (WP-API) 2.0-beta9 or later or WordPress 4.4 or later.
- Requires SearchWP Version 2.6 or later

Technically will work without SearchWP, but queries will run through WP\_Query.

### Example Queries

[](#example-queries)

For a complete list of possible queries, see:

- `wp-json/swp_api/search?s=jedi&engine=star-wars`
- `wp-json/swp_api/search?&tax_query[field]=slug&tax_query[taxonomy]=categories&tax_query[terms]=1`
- `wp-json/swp_api/search?meta_query[key]=jedi&meta_query[value]=luke&tax_query[compare]=IN`

### Other Post Types

[](#other-post-types)

- Added in version 1.2.0 By default query is against posts, to query against the post type "jedi" use:
- - `wp-json/swp_api/search?s=rey&post_type=jedi`

### Multiple Meta Queries

[](#multiple-meta-queries)

Nested meta queries added in version 1.1.0 and allow for querying by multiple meta fields. Be sure to see the [relevant section of the WP\_Query docs](https://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters)

##### Simple Nested Query

[](#simple-nested-query)

Use a `[]` to create a basic nested query. Default meta\_relation is AND. Default compare is IN.

Example: Search where jedi field is "luke" and sith field is "vader".

URL String: `/wp-json/swp_api/search?meta_query[key][]=jedi&meta_query[value][]=luke&meta_query[key][]=sith&meta_query[value][]=vader`

Translates to:

```
'meta_query' => array (
  'relation' => 'AND',
  array (
    'key' => 'jedi',
    'value' => 'luke',
    'compare' => 'IN',
  ),
  array (
    'key' => 'sith',
    'value' => 'vader',
    'compare' => 'IN',
  ),
)
```

##### Relationships Between Query Parts

[](#relationships-between-query-parts)

Use variable `meta_relation` to change relationship been queries. Also, you can set compare, like with regular meta\_queries. Make sure your compare argument is in the right order.

Example: Search where jedi field is "luke" or sith field is not "vader".

URL String `wp-json/swp_api/search?meta_query[key][]=jedi&meta_query[value][]=luke&meta_query[compare][]=in&meta_query[key][]=sith&meta_query[value][]=vader&meta_query[compare][]=NOT%20IN&meta_relation=OR`

Translates to:

```
'meta_query' => array (
  'relation' => 'OR',
  array (
    'key' => 'jedi',
    'value' => 'luke',
    'compare' => 'IN',
  ),

  array (
    'key' => 'sith',
    'value' => 'vader',
    'compare' => 'NOT IN',
  ),
)
```

##### Multiple Values In A Query Part

[](#multiple-values-in-a-query-part)

Put multiple fields into your query parts, by adding extra nesting levels in URL string. Order gets very tricky, numbers (remember to start at 0) help, as shown below.

Example: Search where jedi field is "luke" or "obi-wan" and sith field is not "vader".

URL STRING: `wp-json/swp_api/search?meta_query[key][]=jedi&meta_query[value][0][]=luke&meta_query[value][0][]=obi-wan&meta_query[compare][]=in&meta_query[key][]=sith&meta_query[value][]=vader&meta_query[compare][]=NOT%20IN&meta_relation=AND`

```
array (
  'relation' => 'AND',
  array (
    'key' => 'jedi',
    'value' => array ('luke', 'obi-wan' ),
    'compare' => 'IN',
  ),
  array (
    'key' => 'sith',
    'value' => 'vader',
    'compare' => 'NOT IN',
  ),
)
```

### License &amp; Copyright

[](#license--copyright)

- Copyright 2015 Josh Pollock for CalderaWP LLC.
- Licensed under the terms of the [GNU General Public License version 2](http://www.gnu.org/licenses/gpl-2.0.html) or later.
- Please share with your neighbor.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 94.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~333 days

Recently: every ~414 days

Total

6

Last Release

2305d ago

Major Versions

0.3.0 → 1.0.02015-07-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/d69ded7ff395fe086c58984188d0dc79a5d492aa212b038805caffbb4b89bf7c?d=identicon)[josephfusco](/maintainers/josephfusco)

![](https://www.gravatar.com/avatar/86462a839287f8f512fe9222f33d3369129aed32d9e7a7eb636489e67c5008f7?d=identicon)[ipetty](/maintainers/ipetty)

---

Top Contributors

[![Shelob9](https://avatars.githubusercontent.com/u/1994311?v=4)](https://github.com/Shelob9 "Shelob9 (33 commits)")[![josephfusco](https://avatars.githubusercontent.com/u/6676674?v=4)](https://github.com/josephfusco "josephfusco (2 commits)")

---

Tags

wordpresswp-apisearchwpwp-json-api

### Embed Badge

![Health badge](/badges/masonitedoors-searchwp-api-route/health.svg)

```
[![Health](https://phpackages.com/badges/masonitedoors-searchwp-api-route/health.svg)](https://phpackages.com/packages/masonitedoors-searchwp-api-route)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[wp-coding-standards/wpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress coding conventions

2.7k42.5M1.6k](/packages/wp-coding-standards-wpcs)[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[airesvsg/acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API

1.4k75.0k](/packages/airesvsg-acf-to-rest-api)[phpcompatibility/phpcompatibility-wp

A ruleset for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.

21830.6M587](/packages/phpcompatibility-phpcompatibility-wp)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3257.8M898](/packages/szepeviktor-phpstan-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
