WordPress Universal Search Widget

Search Your Site
by Text or Voice

A clean, Google-style search widget for WordPress that works in any language — type or speak, and results appear instantly.

Live Preview — Idle State
Search by text or voice...
4 results
Getting Started with WordPress
2024-11-12
How to Optimize WordPress Speed
2024-10-05
Best WordPress Themes 2024
2024-09-18
Listening State — Voice Active
WordPress themes...
Listening
Text Search
Voice Search
All Languages
RTL / LTR
Zero Dependencies
Features

Everything You Need
in One Widget

Lightweight, fast, and dependency-free. Works straight out of the box on any WordPress site.

🔍

Instant Text Search

Results appear as you type. Searches post titles using a smart scoring engine — exact matches rank first, followed by partial matches and individual word hits.

🎤

Advanced Voice Search

Google-style colored microphone button. Shows live interim text while you speak, then fires the search on the final transcript. Works with any BCP-47 language code.

🌍

Universal Language Support

Text search is Unicode-aware — it matches Arabic, English, French, Chinese, Hebrew, Persian, Japanese, or any other script without extra configuration.

↔️

RTL / LTR Direction

One setting switches the entire widget between right-to-left and left-to-right. Input, results, and layout all adapt automatically.

Posts Cached Instantly

Posts are fetched once on page load via the WordPress REST API and stored in memory. Every subsequent search is instant — no extra network calls.

🎨

Google-Style Design

Pill-shaped bar, subtle shadows, smooth transitions, skeleton loader, staggered result animations — all without a single external library.

📱

Fully Responsive

Adapts perfectly to all screen sizes — desktop, tablet, and mobile. Touch-friendly buttons at every breakpoint.

🛠️

5-Line Configuration

The only thing you ever change: your site URL, voice language, text direction, placeholder text, and maximum results.

How It Works

Simple, Fast,
Four-Step Flow

1
Load

Posts Load Silently

When the page opens, the widget quietly calls the WordPress REST API and caches all post titles and links in memory.

2
Input

Type or Speak

For text: results appear after 2 characters with a 200ms debounce. For voice: click the mic, speak, and the transcript fills the input automatically.

3
Score

Ranked Results Appear

Each post is scored — exact title match 100, partial match 60, individual words +15. Top results are shown with matched words highlighted.

4
Go

Click to Navigate

Each result card links directly to the post in a new tab. Clicking outside or pressing Escape closes the results panel.

Installation

Up and Running
in Minutes

No plugins, no npm, no build tools. Just paste and configure.

1

Configure the Widget

Edit these 5 values at the top of the script

JavaScript
var SITE_URL = "https://your-site.com";
var VOICE_LANG = "en-US";
var DIR = "ltr";
var PLACEHOLDER = "Search...";
var MAX = 20;
SettingDescriptionExample
SITE_URLYour WordPress URL, no trailing slash"https://myblog.com"
VOICE_LANGBCP-47 language code for voice recognition"ar-SA" / "fr-FR"
DIRText direction for input and layout"ltr" or "rtl"
PLACEHOLDERHint text in the empty search box"Search the site..."
MAXMaximum number of results to display20
2

Embed in Your Page

Four ways to add the widget to your site

A

WordPress — HTML Block

In the Block Editor, add a Custom HTML block and paste the full widget code inside it.

B

WordPress — Theme File

Open header.php or footer.php in your theme and paste the widget code where needed.

C

Any HTML Site

Copy the <div id="wsr"> block and <script> tag and paste into any page body.

D

CORS Requirement

The widget calls /wp-json/wp/v2/posts. Ensure your REST API is publicly accessible.

Common Voice Language Codes
// Arabic
"ar-SA" // Saudi   "ar-EG" // Egyptian   "ar-MA" // Moroccan
// European
"en-US"   "fr-FR"   "de-DE"   "es-ES"   "it-IT"
// Asian
"zh-CN"   "ja-JP"   "ko-KR"   "hi-IN"   "tr-TR"
Compatibility

Works Everywhere

🌐
Chrome
Full support
🦊
Firefox
Text only *
🧭
Safari
Full support
🔷
Edge
Full support
📱
Mobile Chrome
Full support
🍎
Mobile Safari
Full support
WordPress 5+
REST API required
🌍
Any HTML Site
Standalone use

* Firefox does not support the Web Speech API. The mic button is automatically hidden; text search works fully.

أداة البحث الشامل — ووردبريس

ابحث في موقعك
بالنص أو بالصوت

أداة بحث بتصميم Google على موقع ووردبريس الخاص بك — تعمل بأي لغة، تُحمَّل فوراً، ولا تحتاج إلى أي إضافات خارجية.

معاينة مباشرة — الحالة العادية
ابحث بالنص أو الصوت...
4 نتائج
دليل البدء مع ووردبريس
2024-11-12
كيفية تسريع موقع ووردبريس
2024-10-05
أفضل قوالب ووردبريس 2024
2024-09-18
حالة الاستماع — الميكروفون نشط
قوالب ووردبريس...
جارٍ الاستماع
بحث نصي
بحث صوتي
جميع اللغات
RTL / LTR
بدون مكتبات خارجية
المميزات

كل ما تحتاجه
في أداة واحدة

خفيفة، سريعة، بدون أي اعتماديات خارجية. تعمل مباشرة على أي موقع ووردبريس.

🔍

بحث نصي فوري

تظهر النتائج أثناء الكتابة. يبحث في عناوين المقالات باستخدام نظام تسجيل ذكي — التطابق الكامل أولاً، ثم الجزئي، ثم الكلمات المنفردة.

🎤

بحث صوتي متطور

زر ميكروفون بألوان Google الأصلية. يعرض النص مباشرة أثناء الكلام، ثم يُطلق البحث عند انتهاء التعرف. يدعم أي كود لغة BCP-47.

🌍

دعم كامل لجميع اللغات

البحث النصي يعمل مع Unicode — يتعرف على العربية والإنجليزية والفرنسية والصينية والعبرية والفارسية واليابانية وغيرها بدون أي إعداد.

↔️

دعم RTL و LTR

إعداد واحد يُبدّل الأداة بالكامل بين العربي (يمين لليسار) والإنجليزي (يسار لليمين). الإدخال والنتائج والتخطيط كلها تتكيف تلقائياً.

تحميل المقالات مرة واحدة

تُجلب المقالات عند تحميل الصفحة عبر WordPress REST API وتُخزَّن في الذاكرة. كل بحث لاحق فوري — لا طلبات شبكة إضافية.

🎨

تصميم على طراز Google

شريط بحث دائري، ظلال ناعمة، انتقالات سلسة، محمّل هيكلي، وأنيميشن متتابع للنتائج — كل هذا بدون مكتبة واحدة.

📱

متجاوب مع جميع الشاشات

يتكيف مع جميع أحجام الشاشات — سطح المكتب، الجهاز اللوحي، والهاتف. أزرار ملائمة للمس وخطوط مناسبة في كل نقطة توقف.

🛠️

إعداد بـ 5 أسطر فقط

كل ما تحتاج تغييره: رابط موقعك، لغة الصوت، اتجاه النص، نص العنصر النائب، والحد الأقصى للنتائج. كل شيء آخر تلقائي.

آلية العمل

بسيط، سريع،
أربع خطوات

١
التحميل

يعمل الجلب في الخلفية

عند فتح الصفحة، تستدعي الأداة WordPress REST API بصمت وتُخزّن جميع عناوين وروابط المقالات في الذاكرة.

٢
الإدخال

نص أو صوت

للنص: تظهر النتائج بعد حرفين مع تأخير 200ms. للصوت: اضغط الميكروفون وتكلّم، ويُوضع النص تلقائياً في مربع البحث.

٣
النتائج

نظام التسجيل الذكي

لكل مقال درجة — تطابق العنوان الكامل 100، جزئي 60، الكلمات المنفردة +15. تُعرض أفضل النتائج مرتبة مع تمييز الكلمات.

٤
الانتقال

نقرة واحدة تكفي

كل بطاقة نتيجة تفتح المقال في تبويب جديد. النقر خارج الأداة أو الضغط على Escape يُغلق لوحة النتائج.

التركيب

تشغيل الأداة
في دقائق

لا إضافات، لا npm، لا أدوات بناء. فقط الصق وعدّل الإعدادات.

١

تعديل الإعدادات

غيّر هذه القيم الخمس في أعلى الكود

JavaScript
var SITE_URL = "https://your-site.com";
var VOICE_LANG = "ar-SA";
var DIR = "rtl";
var PLACEHOLDER = "ابحث بالنص أو الصوت...";
var MAX = 20;
الإعدادالوصفمثال
SITE_URLرابط موقعك بدون شرطة مائلة في النهاية"https://myblog.com"
VOICE_LANGكود BCP-47 للغة التعرف الصوتي"ar-SA" / "en-US"
DIRاتجاه النص في مربع البحث"rtl" أو "ltr"
PLACEHOLDERالنص التوضيحي داخل مربع البحث الفارغ"ابحث في الموقع..."
MAXالحد الأقصى لعدد النتائج المعروضة20
٢

تضمين الأداة في موقعك

أربع طرق لإضافة الأداة إلى صفحتك

أ

ووردبريس — كتلة HTML مخصصة

في محرر الكتل، أضف كتلة Custom HTML، الصق محتوى ملف الأداة كاملاً بداخلها، ثم انشر.

ب

ووردبريس — ملف القالب

افتح ملف header.php أو footer.php في قالبك، والصق كود الأداة في المكان المطلوب.

ج

أي موقع HTML

انسخ <div id="wsr"> وعنصر <script> والصقهما في جسم أي صفحة HTML.

د

ملاحظة مهمة — CORS

الأداة تستدعي /wp-json/wp/v2/posts. تأكد أن REST API متاح للعموم.

أكواد اللغات الصوتية الشائعة
// العربية
"ar-SA" // سعودي   "ar-EG" // مصري   "ar-MA" // مغربي
// الأوروبية
"en-US"   "fr-FR"   "de-DE"   "es-ES"   "it-IT"
// الآسيوية
"zh-CN"   "ja-JP"   "ko-KR"   "hi-IN"   "tr-TR"
التوافق

تعمل في كل مكان

🌐
Chrome
دعم كامل
🦊
Firefox
النص فقط *
🧭
Safari
دعم كامل
🔷
Edge
دعم كامل
📱
Chrome للموبايل
دعم كامل
🍎
Safari للموبايل
دعم كامل
ووردبريس 5+
يتطلب REST API
🌍
أي موقع HTML
استخدام مستقل

* Firefox لا يدعم Web Speech API. يُخفى زر الميكروفون تلقائياً؛ البحث النصي يعمل بشكل كامل.