Amirhossein HosseinpourAmirhpCom
Resume Book a consultationBook
Delivered WordPress plugin · Custom build

WordPress Live Search (ajaxerch)

Search results as you type, through three different routes.

Live search for WordPress that can run through the REST API, admin-ajax, or a template redirect that works with page caching.

All portfolio

// what-it-does

What it does

Which route is fastest depends on the host. So it offers three.

Results appear while the visitor types. The REST API is the clean route, admin-ajax is the most compatible one, and the template redirect lets a page cache serve repeated searches.

Routes

  • WordPress REST API
  • admin-ajax.php
  • A template redirect, for caching

// how-it-was-built

How it was built

PHP for the three endpoints, JavaScript for the search box.

Filed under WordPress and WooCommerce on the old portfolio, since it searched products as well as posts.

WordPressPHPJavaScriptREST APIAJAXCaching
Status

A custom build from before 2022. The code was never published and I no longer maintain it; this page keeps the record of what it did.

branch main 6 active projects ↑ 113 releases portfolio/wordpress-ajaxerch.md Sari --:-- UTC+3:30 its@amirhp.com