WPML: Category exclusions
Relevanssi category exclusion setting doesn’t work properly with WPML. Here’s a bit of code from Srdjan Jocić from OnTheGoSystems that fixes it. Just add this to your theme functions.php.
Knowledge base contains information on how to use Relevanssi. There are lots of features that are documented in the knowledge base. Here's an index to the knowledge base, with all the entries sorted under different topics.
The user manual functions page is also a good place to look at.
Relevanssi category exclusion setting doesn’t work properly with WPML. Here’s a bit of code from Srdjan Jocić from OnTheGoSystems that fixes it. Just add this to your theme functions.php.
If you have Relevanssi Premium and want to make Relevanssi understand French plurals, you can add this code to your site: Then just rebuild the index, and now searching for plurals will also find the singular form. This is a very simple way to handle the plurals: it will simply strip the final “s” or…
…know the exact field name. In that case you can use a direct database call to fetch fields using wild cards. This function would find a relationship field called people inside a flexible content field sidebar_groups: add_filter( ‘relevanssi_content_to_index’, ‘rlv_relationship_content’, 10, 2 ); function rlv_relationship_content( $content, $post ) { global $wpdb;…
Relevanssi Premium has support for in-query Boolean operators. Relevanssi uses + and – for the operators: cats -dogs and cats +kittens. If you prefer instead to use the verbal AND and NOT operators, it only takes one small function. Add this to your site: This function (on the relevanssi_search_filters hook) looks at the search query…
Advanced Custom Fields makes it possible to add custom fields to taxonomy terms. You can only do this with Relevanssi Premium because the free version of Relevanssi can’t index taxonomy terms. Suppose you set Relevanssi to index custom fields. Relevanssi won’t index these taxonomy custom fields because taxonomy terms aren’t generally allowed to have custom…
Custom fields (also known as post meta or meta fields) are a major part of WordPress the default search won’t search. That’s a big problem for people who use solutions like Advanced Custom Fields or Carbon Fields to develop sites: on sites developed with custom field plugins large parts of the post, content may be…
…One example is searching for attachments. By default, SearchWP Live Ajax Search doesn’t include any attachments in the search results. The post type is not a problem, but the post status is: SearchWP Live Ajax Search includes only posts with the post status publish, while attachments have a status of…Relevanssi doesn’t ship with a live search or autocomplete feature that would display results as the user types the search terms. There are many other plugins that provide this functionality, but few of these plugins work with Relevanssi. SearchWP Live Ajax Search is the best one that does. It’s very……to include private posts for the users who are allowed to see them. Just removing the post_status parameter will include drafts in the results. Normally drafts shouldn’t appear in searches, but since the SearchWP Live Ajax Search is an AJAX search, it is done in admin context, where drafts are…
…service on a separate server. Which PDF files can you index? Since Relevanssi is a WordPress search, Relevanssi operates on WordPress posts (including all the different post types). So, to have Relevanssi index your PDFs, they need to be WordPress posts. That’s fortunately really simple: upload your PDF files to……or EU. You can choose from the settings which server you want to use. There the files are processed with Tika. While we don’t care what’s inside the files you index on our server, the server needs to make working copies. The server removes the documents after use. It is……attachments? Yes! Relevanssi can handle lots of different formats. Our server uses Apache Tika to process the files, giving us a wide variety of supported formats. The essential document formats are covered: Word documents (DOC and DOCX), Open Office documents (ODT), RTFs, etc. How does the attachment indexing work? Relevanssi…
By default posts imported with WP All Import do not get indexed by Relevanssi. The importing process does not trigger Relevanssi indexing. That is, however, easy to remedy: Add this code to your site, and any posts imported with WP All Import will be indexed with Relevanssi. Do note that this will make the importing…
I have some trouble with reindexing of new posts. The reason is simple – I sync data into the database automatically. So what I need is a cronjob to reindex the site once a day. How do I do a cronjob? The easiest way would be to get Relevanssi Premium and use WP CLI, so…