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 Premium 2.8 / Free 4.7

Premium 2.8 / Free 4.7

These versions add new features, but these are mostly small and of interest to developers. As a big change Relevanssi is now active in Media Library searches in the admin backend (if admin searches are enabled): feedback on this is welcome. Excerpts should be slightly better, especially when content stopwords are involved and post part…

Read more Premium 2.8 / Free 4.7 2 Comments on Premium 2.8 / Free 4.7
Continue reading Indexing embedded PDFs for the parent post

Indexing embedded PDFs for the parent post

…} } return $block; } ); PDF.js Viewer Shortcode PDF.js Viewer Shortcode uses a shortcode with the file name in the url parameter. add_filter( ‘relevanssi_content_to_index’, ‘rlv_pdfjs_content’, 10, 2 ); function rlv_pdfjs_content( $content, $post ) { $m = preg_match_all( ‘/\[pdfjs-viewer url=[“\’](.*?)[“\’]/’, $post->post_content, $matches ); if ( $m ) { global $wpdb;……need to establish a connection between the PDF and the post, based on the URL in the shortcode. The same code works with different PDF embedders; you only have to adjust the regex to match the shortcode used by the plugin. WordPress Core File block If you use the default……WordPress. Thus, Relevanssi won’t know the PDF is embedded in the post and cannot index the PDF contents for the parent post. Most of these plugins use shortcodes to embed the PDF viewer on a page. To get Relevanssi to index the embedded PDF contents for the parent post, you…

Read more Indexing embedded PDFs for the parent post 5 Comments on Indexing embedded PDFs for the parent post