Continue reading Indexing post slugs

Indexing post slugs

By default, Relevanssi does not index the post slug. It is, however, an easy thing to fix using the relevanssi_content_to_index filter hook. This function will read the post slug, replace the hyphens with spaces (so that indexing-post-slugs becomes “indexing post slugs”) and add the slug to the post content. Add this function to your site…

Read more Indexing post slugs 0 Comment on Indexing post slugs
Continue reading Blocking pre and code tags

Blocking pre and code tags

If your posts have lots of programming code examples in <pre> and <code> tags, those might look pretty bad in the search results. A snippet of programming code isn’t usually a good excerpt, and if you use those tags purely for code snippets, they won’t likely contain significant search content, either. Fortunately it’s easy to…

Read more Blocking pre and code tags 0 Comment on Blocking pre and code tags
Continue reading ACF: Indexing ACF fields for taxonomy terms

ACF: Indexing ACF fields for taxonomy terms

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…

Read more ACF: Indexing ACF fields for taxonomy terms 2 Comments on ACF: Indexing ACF fields for taxonomy terms
Continue reading Index custom field contents

Index custom field contents

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…

Read more Index custom field contents 45 Comments on Index custom field contents
Continue reading Indexing and searching PDFs in WordPress

Indexing and searching PDFs in WordPress

Relevanssi Premium users have asked for PDF indexing since day one, and version 2.0 finally introduced this feature. Coming up with a fast and reliable method hasn’t been easy, but we’re pretty proud of what we have now. Our PDF indexer doesn’t tax your server as it runs as a service on a separate server.…

Read more Indexing and searching PDFs in WordPress 78 Comments on Indexing and searching PDFs in WordPress
Continue reading WooCommerce: Indexing product variation SKUs for main product

WooCommerce: Indexing product variation SKUs for main product

Relevanssi can index product and product variation SKUs for WooCommerce products: just add _sku to list of custom fields to index. However, if you want to find the main product when searching for the product variation SKU, you need some extra code using the relevanssi_content_to_index filter hook. Add this function to your site and rebuild…

Read more WooCommerce: Indexing product variation SKUs for main product 16 Comments on WooCommerce: Indexing product variation SKUs for main product
Continue reading Indexing private custom fields for admins only

Indexing private custom fields for admins only

I use private custom fields. I want to index them in the administration but not on the public site. How to do ? Initially this seems impossible to do with Relevanssi, but it’s possible. Doing this requires Relevanssi Premium. The free version doesn’t know which custom field matches the search term, it just knows some custom…

Read more Indexing private custom fields for admins only 0 Comment on Indexing private custom fields for admins only
Continue reading Indexing usermeta fields in Relevanssi

Indexing usermeta fields in Relevanssi

Relevanssi Premium can index user profiles. Users may have meta fields attached to them: there’s a wp_usermeta database table, even though the user editing interface by default doesn’t have any tools to add meta fields to users. Codex includes documentation on how to use the user meta fields. Read Working with User Metadata for code…

Read more Indexing usermeta fields in Relevanssi 2 Comments on Indexing usermeta fields in Relevanssi
Continue reading Controlling attachment types in index

Controlling attachment types in index

Relevanssi lets you index attachments. But perhaps you only want to index a particular type of attachment? Relevanssi settings don’t have any control over that, it’s either all attachments or nothing. It is possible to choose which kinds of attachments are indexed. It is done with the relevanssi_indexing_restriction filter hook, which lets you control which…

Read more Controlling attachment types in index 16 Comments on Controlling attachment types in index