Current version: 1.8.4 View Changelog

Download available with active license

This extension provides Shortcodes that generate both search forms and results pages for SearchWP search engines. It’s useful if you’re not comfortable (or able) to edit theme files directly to implement your search form(s) and results loops.

After activating Shortcodes, the following will be available to you:

Shortcode Attribute(s)
Outputs a search form for a specific search engine
target — The form action (Default is the existing permalink)
engine — Search engine name (Default is default)
var — The search query variable name (Default is swpquery)
button_text — Form button text (Default is Search)
hide_button — Either “true” or “false”, hides the search form submit button
placeholder — Form input placeholder text (Default is Search)
live_search — Either “true” or “false”, force enable/disable Live Ajax Search for this form, ignoring the value of the global “Enable Live Search” setting
Outputs the list of search results once a search has been submitted
engine — Search engine name (Default is default)
var — The search query variable name (Default is swpquery)
posts_per_page — How many posts per page to display
Note that this is not a self-closing Shortcode, the markup for each search result should be nested inside, see the sample below for example
Outputs a link to the current search result with the text of the result’s title
direct — Either “true” or “false”, when true link directly to the permalink, if it’s an attachment link directly to it’s URL, not the parent page
Outputs the excerpt for the current search result
Output if no search results were found

Note that this is not a self-closing Shortcode, the markup for each search result should be nested inside, see sample below for example

Outputs pagination of search results
engine — Search engine name (Default is default)
direction — Either “prev” or “next”
link_text — The text to use in the link
var — The search query variable name (Default is swpquery)
Outputs paginated links for search results
engine — Search engine name (Default is default)
var — The search query variable name (Default is swpquery)In addition to the above, arguments from paginate_links are also supported.
Outputs Featured Image for the current result
size — Image size (Default is thumb)
Outputs permalink for the current result with the text of the result’s permalink
direct — Whether to link directly to Media files (Default is 'true')
Outputs a total number of results for the current search
engine — Search engine name (Default is default)
var — The search query variable name (Default is swpquery)
text — The text to use alongside the number of results. Supports %total% and %query% placeholders for precise formatting.[searchwp_total_results text="Found %total% results for %query%"] converts to “Found 0 results for example search”.

Here is a sample of a comprehensive implementation of Shortcodes that searches a supplemental engine with a name of my_test_engine :

<h3>Search Form</h3>
[searchwp_search_form engine="my_test_engine" target="" var="swpquery" button_text="Find Results"]
<div class="search-results-wrapper">
[searchwp_total_results text="Found %total% results for %query%" engine="my_test_engine" var="swpquery"]
[searchwp_search_results engine="my_test_engine" var="swpquery" posts_per_page=10]
<h2>[searchwp_search_result_link direct="true"]</h2>
<div class="no-search-results-found">
No results found, please search again.
<div class="search-results-pagination">
[searchwp_search_results_pagination direction="prev" link_text="Previous" var="swpquery" engine="my_test_engine"]
[searchwp_search_results_pagination direction="next" link_text="Next" var="swpquery" engine="my_test_engine"]
view raw gistfile1.html hosted with ❤ by GitHub

You can customize the attributes as per the table above.



  • [New] Added option to hide submit button.


  • [New] Compatibility with Live Ajax Search.
  • [Improvement] The searchwp_total_results shortcode supports text customizations.


  • [Fix] Prevent Error due to Shortcode recursion.
  • [Update] Updated updater.


  • [Fix] posts_per_page attribute not reflected when using SearchWP 4.


  • [New] New Shortcode searchwp_search_results_paginate_links for paginated links.
  • [New] New Shortcode searchwp_search_result_image for result Featured Image output.
  • [New] New Shortcode searchwp_search_result_permalink for result permalink output.
  • [Update] Updated updater.


  • [New] Compatibility with SearchWP 4.


  • [Fix] Issue with handling quotes.


  • [New] New Shortcode: searchwp_total_results to output the total number of search results.
  • [New] Adds placeholder argument to searchwp_search_form Shortcode.
  • [Update] Updated updater.


  • [Fix] Additional checks to prevent edge case function redeclaration.
  • [Update] Updated updater.


  • [New] New filter: searchwp_shortcodes_engine.
  • [New] New filter: searchwp_shortcodes_paginate_links.
  • [New] New filter: searchwp_shortcodes_pagination_prev.
  • [New] New filter: searchwp_shortcodes_pagination_next.
  • [Update] Updated updater.


  • [New] New Shortcode [searchwp_search_result_excerpt_global].
  • [New] New Shortcode [searchwp_search_result_excerpt_document].
  • [Improvement] Refined escaping so as to better pair with Term Highlight.


  • [Improvement] Support for automatic updates based on your SearchWP license key.


  • [New] Added a number of actions during output.


  • [Change] Allow GET variable to be set in Shortcode attribute, among other things.


  • [Fix] Fixed an issue where attributes weren't passed to the Shortcode callback.


  • Initial release.

Want to make your search awesome right now?

More than 30,000 sites have chosen SearchWP!

You can utilize all of the content that’s gone unrecognized by native WordPress keyword search instantly with SearchWP.

Get SearchWP for just $99

  • Committed Support
    If you need help, support is fast, friendly, and here for you
  • Streamlined Setup
    Installation and setup that’s optimized for speed
  • Great Documentation
    Helpful, clear, and usable documentation is a priority

See what SearchWP customers have to say

  • “SeachWP is easy to set up and has all the customizing I need to help my clients deliver a better search experience than the native WP search functionality. It also has great analytics that help their content strategy.”

  • “I approached the support team with an idea for a customised implementation of the SearchWP weighting system. I was really just looking for a point in the right direction, but Jon went above and beyond all expectations to help me.”

  • “Powerful and flexible; excellent for building custom search engines and extending search across custom post types and fields. Intuitive and user-friendly interface; lots of add-ons; excellent API, documentation, and customer support to boot.”