…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……$upload_dir = wp_upload_dir(); foreach ( $matches[1] as $pdf ) { $pdf_url = ltrim( str_replace( $upload_dir[‘baseurl’], ”, urldecode( $pdf ) ), ‘/’ ); $pdf_content = $wpdb->get_var( $wpdb->prepare( “SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = ‘_relevanssi_pdf_content’ AND post_id IN ( SELECT post_id FROM $wpdb->postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = %s……meta_key = ‘_wp_attached_file’ AND meta_value = %s )”, $pdf_url ) ); $content .= $pdf_content; } } return $content; } If you use the Gutenberg block, the code is different and uses the relevanssi_block_to_render filter hook: add_filter( ‘relevanssi_block_to_render’, ‘rlv_pdfembedder_content’, 10 ); function rlv_pdfembedder_content( $block ) { if ( $block[‘blockName’] === ‘pdfemb/pdf-embedder-viewer’…