WP Static Search

This plugin adds a static search engine to your WordPress site. Static in this context means that it works in the browser without using of server-side …

Author:Gergely Szerovay (profile at wordpress.org)
WordPress version required:5.2
WordPress version tested:5.4.6
Plugin version:1.0.2
Added to WordPress repository:11-05-2020
Last updated:11-05-2020
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:90
Rated by:2
Plugin URI:https://github.com/gergelyszerovay/wp-static-...
Total downloads:556
Active installs:10+
plugin download
Click to start download

WP Static Search

This plugin adds a static search engine to your WordPress site. Static in this context means that it works in the browser without using of server-side queries, so it’s ideal for static websites generated from a WordPress site.

Since both the search and the indexing happens in the browser, this plugin is not a good fit for sites that contain hundreds of pages and posts.

Getting Started

After you are installed the plugin, choose the ”Static Search” option from the left sidebar of the WordPress admin interface. Press the ”Update Index” button and wait until the indexing is finished. Each time you change the content of the website, you should update the search index manually.

To insert the search box and the search results into the site, use the [static_search] shortcode. It’s a good practice to create a page called ”Search” with the slug ”/search/” and insert the [static_search] shortcode into this page. To redirect the search widgets to this page, append the following code to the bottom of your .htaccess file:

RewriteCond %{QUERY_STRING} \\?s=([^&]+) [NC]

RewriteRule ^$ /search/?q=%1 [NC,R,END]

This code redirects the search queries to the /search/ page, then the [static_search] shortcode processes them and shows the search results.

Built With

lunar.js – Javascript search engine

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the Apache 2 and GPL2+ Licenses
Acknowledgments

The frontend search code based on the MkDocs project’s search plugin.