Indexing embedded PDFs for the parent post
…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…Relevanssi can automatically index PDF content for the parent post if the PDF (or other attachment) is attached to the parent post in WordPress. However, that’s not always the case. Sometimes the PDF is attached to the page using an embed, which doesn’t create a connection between the posts in……File block from WordPress, this snippet will index the PDF contents for the post where the file is embedded: add_filter( ‘relevanssi_block_to_render’, function( $block ) { if ( ‘core/file’ === $block[‘blockName’] ) { $file_id = $block[‘attrs’][‘id’]; $file_content = get_post_meta( $file_id, ‘_relevanssi_pdf_content’, true ); if ( $file_content ) { $block[‘innerContent’][0] = $file_content;…