Continue reading Indexing attachments from File blocks

Indexing attachments from File blocks

The Relevanssi attachment indexing assumes the files are connected to the posts using the WordPress attachment mechanism. What if you don’t use that but instead add the files to the pages using the File block in the block editor? That’s not a problem, but it requires some extra code. Add this function to your site…

Read more Indexing attachments from File blocks 0 Comment on Indexing attachments from File blocks
Continue reading Polylang: Bilingual search

Polylang: Bilingual search

By default, Relevanssi indexes the different language versions of the posts separately. If your site is in French and English, searching for the English text will find the English posts and searching for the French text will find the French posts. But what if you want the French search terms to find the English post…

Read more Polylang: Bilingual search 0 Comment on Polylang: Bilingual search
Continue reading Index only short numbers

Index only short numbers

Relevanssi has a minimum word length setting that is set to three characters. Any one- or two-letter words are not indexed unless you change this setting from the Relevanssi advanced indexing settings. Sometimes it would be helpful to ignore short words but to index one- and two-digit numbers. You can do that with a bit…

Read more Index only short numbers 0 Comment on Index only short numbers
Continue reading ACF: Filtering custom fields by type

ACF: Filtering custom fields by type

On sites where ACF fields are used a lot, with Flexible Content and Repeater fields, it may be difficult to make Relevanssi only index the relevant ACF fields. One way to deal with problem is to set Relevanssi to index “visible” custom fields and then restrict the indexed fields by field type. Add this function…

Read more ACF: Filtering custom fields by type 0 Comment on ACF: Filtering custom fields by type
Continue reading Indexing fails? Check max_allowed_packet!

Indexing fails? Check max_allowed_packet!

Sometimes Relevanssi can get stuck in the indexing. Relevanssi goes past the number of posts in the database and keeps indexing the posts. One possible cause is a too small max_allowed_packet value for your MySQL server. This value controls how big queries your MySQL server can take. You can see the current value with one…

Read more Indexing fails? Check max_allowed_packet! 0 Comment on Indexing fails? Check max_allowed_packet!
Continue reading Reading wpDataTables imported tables

Reading wpDataTables imported tables

The wpDataTables table plugin has several ways to handle tables. Some of them work with Relevanssi without problems; some don’t. You may notice that Relevanssi doesn’t index the entire table contents for wpDataTables tables (mainly imported tables). This is because the wpDataTables shortcode does not always expand to the entire table; it only features part…

Read more Reading wpDataTables imported tables 0 Comment on Reading wpDataTables imported tables
Continue reading Polylang Pro: Indexing synced posts

Polylang Pro: Indexing synced posts

Polylang Pro has a feature to sync translations between posts. The problem with this and Relevanssi is that Relevanssi does not index the changes to the synced posts. With this filter function added to your site, Relevanssi will also index the synced posts: Thanks to Nico von Niederhäusern / Cubetech. There’s also a method for…

Read more Polylang Pro: Indexing synced posts 0 Comment on Polylang Pro: Indexing synced posts
Continue reading 10Web Photo Gallery

10Web Photo Gallery

The Photo Gallery plugin from 10Web uses a shortcode to add photo galleries to posts and pages. By default, Relevanssi doesn’t index the gallery contents. Photo Galler only registers the shortcode in the front end, so when Relevanssi indexes pages in the admin context, Relevanssi only sees the shortcode, not the gallery contents. To fix…

Read more 10Web Photo Gallery 0 Comment on 10Web Photo Gallery
Continue reading Increasing weight for HTML tags

Increasing weight for HTML tags

Relevanssi ignores HTML tags when indexing posts. If you want to give more weight to words that appear in specific HTML tags (like headings), here is one way to do that. You can add this filter function on your site to the theme functions.php or in a code snippet: This code goes through the post…

Read more Increasing weight for HTML tags 0 Comment on Increasing weight for HTML tags
Continue reading Indexing image alt texts

Indexing image alt texts

Relevanssi by default ignores image alt texts (and other tag attributes). That’s often the right thing to do because alt texts aren’t visible to users. Finding a post with a search term that only appears in an alt text may confuse a user. If your alt texts are well crafted, they may help search. It’s…

Read more Indexing image alt texts 0 Comment on Indexing image alt texts