REST API for Relevanssi
This plugin provides simple REST API for the popular search WordPress search engine – Relevanssi. As far as this plugin provides API for the Relevanssi plugin, it should be installed. Key features Search through posts of a certain type. By default all types. Results in pagination and optional. Sets X-WP-Total header with a total number of records, the same way as the default search API does. Sets X-WP-TotalPages header with a total number of pages, the same way as the default search API does. Multilingual websites support. Both WPML and Polylang are supported, but not tested well, so let me know if you will find any problems. Taxonomy filters are supported now. Some features may be missed, so feel free to report them. Ordering option added. It is also possible to order by meta_key/meta_value/meta_value_num. Brief usage examples https://[your domain]/wp-json/relevanssi/v1/search?keyword=query https://[your domain]/wp-json/relevanssi/v1/search?keyword=query&per_page=5 https://[your domain]/wp-json/relevanssi/v1/search?keyword=query&per_page=5&page=2 Define post type: https://[your domain]/wp-json/relevanssi/v1/search?keyword=query&per_page=5&page=2&type=post Filter by taxonomy/taxonomies: https://[your domain]/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3 https://[your domain]/wp-json/relevanssi/v1/search?keyword=test&tax_query[relation]=AND&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3&tax_query[1][taxonomy]=category&tax_query[1][field]=id&tax_query[1][terms]=2 Exclude category via taxonomies: https://[your domain]/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3&tax_query[0][operator]=NOT IN For multilingual websites (WPML & Polylang): https://[your domain]/wp-json/relevanssi/v1/search?keyword=query&lng=en Results in order: https://[your domain]/wp-json/relevanssi/v1/search?keyword=test&type=post&orderby=modified&order=DESC https://[your domain]/wp-json/relevanssi/v1/search?keyword=test&type=post&orderby=modified&order=ASC https://[your domain]/wp-json/relevanssi/v1/search?keyword=test&type=post&meta_key=some_key&orderby=meta_value|meta_value_num&order=ASC Demo website You can try the plugin on our demo website http://demo.erlycoder.com/demo1/. For example, you can try the following request: Basic: http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test Order posts by modification time: http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&type=post&orderby=modified&order=DESC http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&type=post&orderby=modified&order=ASC Filter posts by taxonomy (one single category): http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3 Filter posts by taxonomy (exclude category): [http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3&tax_query[0][operator]=NOT IN](http://demo.erlycoder.com/demo1/wp-json/relevanssi/v1/search?keyword=test&tax_query[0][taxonomy]=category&tax_query[0][field]=id&tax_query[0][terms]=3&tax_query[0][operator]=NOT IN)
Top keywords
- query30×5.44%
- tax25×4.54%
- tax query25×4.54%
- search22×3.99%
- relevanssi19×3.45%
- keyword17×3.09%
- relevanssi v117×3.09%
- relevanssi v1 search17×3.09%
- search keyword17×3.09%
- v117×3.09%
- v1 search17×3.09%
- v1 search keyword17×3.09%
REST XML-RPC Data Checker
JSON REST API and XML-RPC API are powerful ways to remotely interact with WordPress. If you don’t have external applications that need to communicate with your WordPress instance using JSON REST API or XML-RPC API you should disable access to them for external requests. In the standard WordPress installation JSON REST API and XML-RPC API are enabled by default. In particular the REST API is turned on also for unlogged users. This means that your WordPress instance is potentially leaking data, for example anyone could be able to: copy easily your published contents natively with the REST API (and not with a web crawler); get the list of all users (with their ID, nickname and name); retrieve other information that you didn’t want to be public (such as an unlisted published page or a saved media not yet used). Even if you could do the stuff by writing your own code using native filters, this plugin aims to help you to control JSON REST API and XML-RPC API accesses from the administration panel or programmatically by a simple API filter. Basic Features Disable REST API interface for unlogged users. Disable JSONP support on REST API. Add Basic Authentication to REST API. Remove REST tags, REST Link HTTP header and REST Really Simple Discovery (RSD) informations. Setup trusted users, IP/Networks and endpoints for unlogged users REST requests. Change REST endpoint prefix. Disable XML-RPC API interface. Remove to the Really Simple Discovery (RDS) informations. Remove X-Pingback HTTP header. Setup trusted users, IP/Networks and methods for XML-RPC requests. Show user’s access informations in users list administration screen. Usage Once the plugin is installed you can control settings in the following ways: Using the Settings->REST XML-RPC Data Checker administration screen. Programmatically, by using rest_xmlrpc_data_checker_settings filter (see below). API Hooks rest_xmlrpc_data_checker_settings Filters plugin settings values. apply_filters( 'rest_xmlrpc_data_checker_settings', array $settings ) rest_xmlrpc_data_checker_admin_settings Filter allowing to display or not the plugin settings page in the administration. apply_filters( 'rest_xmlrpc_data_checker_admin_settings', boolean $display ) rest_xmlrpc_data_checker_rest_error Filter JSON REST authentication error after plugin checks. apply_filters( 'rest_xmlrpc_data_checker_rest_error', WP_Error|boolean $result ) xmlrpc_before_insert_post Filter XML-RPC post data to be inserted via XML-RPC before to insert post into database. apply_filters( 'xmlrpc_before_insert_post', array|IXR_Error $content_struct, WP_User $user )
Top keywords