- Contributors: pfefferle, johnnoone
- Donate link: https://notiz.blog/donate/
- Tags: opensearch, search, browser, autodiscovery, suggestions
- Requires at least: 6.4
- Tested up to: 7.1
- Stable tag: 4.2.0
- Requires PHP: 7.4
- License: GPL-2.0-or-later
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
Lets browsers search your site straight from the address bar.
Browsers can learn how to search a website if the site tells them. This plugin adds that information to your WordPress site, in the form of an OpenSearch description document.
Once activated, visitors can add your site as a search engine in their browser, or the browser picks it up on its own. Typing a keyword and a search term into the address bar then searches your site instead of the web.
There is nothing to configure. Install it, activate it, done.
- Chrome and Edge: your site shows up under "Site search" in the browser settings. After activating it there, visitors type your domain, hit
Taband search your site. Chrome calls this "Tab to Search". - Firefox: the address bar offers to add your site as a search engine. Visitors can also right click the address bar and pick "Add" (OpenSearch in Firefox).
- Safari: with "Quick Website Search" enabled, Safari remembers your site after the first search and offers it in the address bar.
- Search suggestions: while typing, the browser can show suggestions. The plugin uses your tags for that.
- Your site icon is used as the icon of the search engine, if you have one set under Appearance > Customize > Site Identity.
- The OpenSearch description document at
/wp-json/opensearch/1.1/document - A suggestions endpoint at
/wp-json/opensearch/1.1/suggestions?s=… - Autodiscovery links in the HTML head and in the Atom and RSS feeds
- A search provider entry in the web app manifest, for the "search_provider" WebExtension setting
- Links in host-meta and WebFinger, if those plugins are installed
- Search URLs for the Atom and RSS search responses and the OpenSearch Suggestions extension
- Firefox OpenSearch plugins
- Safari Quick Website Search
- Chrome Tab to Search
Open https://yoursite.com/wp-json/opensearch/1.1/document in your browser. You should see a short XML file with the name of your site and the search URLs.
No. The plugin only describes the search you already have. The browser sends visitors to your normal search results page.
Chrome no longer adds sites on its own. Go to chrome://settings/searchEngines, look for your site under "Inactive shortcuts" and activate it. Edge works the same way under edge://settings/searchEngines.
From your tags. Other plugins can change that with the open_search_document_suggestions filter.
Yes, with the osd_search_url_template filter. The second argument tells you which search URL is filtered: html, atom or rss2.
function custom_osd_extend( $url, $type ) {
return add_query_arg( 'mtm_campaign', 'opensearch', $url );
}
add_filter( 'osd_search_url_template', 'custom_osd_extend', 10, 2 );
The Tags element lists the ten most used tags of your site, as keywords for the search engine. Sites without tags get WordPress blog. The osd_tags filter lets you change the list.
Yes. The osd_xml action runs inside the document, right before the closing tag. The osd_ns action lets you add namespaces to the root element.
- The REST controller extends the WordPress
WP_REST_Controllerclass - Search suggestions keep spaces and upper case letters in the query
- The document no longer has a stray
nullat the end - Site name, description and URLs are escaped for XML
- The suggestions URL has
rel="suggestions"and the document links to itself withrel="self" - Site icons carry their MIME type
- The
Tagselement lists the most used tags of the site, filterable withosd_tags - Removed the
Contactelement, the spec expects an email address there - Removed the
Developerelement - Removed the XRDS-Simple integration, the plugin is closed on WordPress.org
url_template()andfeed_url_template()are deprecated, useget_url_template()- Requires WordPress 6.4 and PHP 7.4
- Added tests and a new readme
- update plugin structure
- fix PHP deprecated: strstr(): Passing null to parameter
- added "search_provider" WebExtension support
- fix broken XML output
- modernize code
- added filters for the search URLs in the OSD document
- fix missing permission callback
- update requirements
- added screenshots
- code improvements
- moved to WordPress API
- fixed site icon implementation
- fixed site icon implementation
- fixed XML output
- encapsulated XML data
- complete refactoring
- WordPress coding style
- Site icon support
- Some smaller fixes
- fixed host-meta link
- added webfinger support
- Added function to flush rewrite_rules
- Autodiscovery for host-meta
- OpenSearch Suggestions extension
- WordPress 2.8.x compatibility
- Autodiscovery for RSS/Atom and XRDS
- Profile-Services
- Initial release
- Install the plugin from the WordPress plugin directory, or upload the
open-search-documentfolder to/wp-content/plugins/ - Activate it through the Plugins menu
- That's it, there are no settings