Download Monitor: Index PDF content for parent page

Relevanssi can handle Download Monitor files without significant problems. If you want to use the “Index PDF contents for the parent page” option, there’s a problem, though. Download Monitor comes in between: the PDF post is attached to the Download Monitor dlm_download post and not the page where the [download]……let’s grab that. $download_id = preg_replace( ‘/[^\d]/’, ”, $meta_field_value ); if ( $download_id ) { // Replace the original post_parent ID with the new one. $query = preg_replace( ‘/post_parent = \d+/’, “post_parent = $download_id”, $query ); } } return $query; } If the [download] shortcode is somewhere in the post……@return string The modified MySQL query. */ function rlv_download_monitor( $query, $post_id ) { $post_object = relevanssi_get_post( $post_id ); $id_matches = preg_match_all( ‘/\[download id=.(\d+).\]/ims’, $post_object->post_content, $matches ); if ( $id_matches ) { $download_id = implode( ‘,’, $matches[1] ); $query = preg_replace( ‘/post_parent = \d+/’, “post_parent IN ($download_id)”, $query ); } return…

WP Download Manager

…in which case the function above needs to be changed to this: $filename = $upload_dir[‘basedir’] . ‘/download-manager-files/’ . array_values( $files )[0]; Limitations With these two small functions Relevanssi can read the files attached to WP Download Manager posts. There’s one major limitation: WP Download Manager posts can contain multiple files,…WP Download Manager is a popular file management plugin for WordPress. It’s unfortunately incompatible with Relevanssi attachment content reading out of the box, as Relevanssi expects the attachments to be stored in the Media Library, and WP Download Manager stores the files outside Media Library. Fortunately Relevanssi includes the necessary……’rlv_wpdmpro_file’, 10, 2 ); function rlv_wpdmpro_file( $filename, $post_id ) { $files = get_package_data( $post_id, ‘files’ ); $upload_dir = wp_get_upload_dir(); $filename = $upload_dir[‘basedir’] . ‘/download-manager-files/’ . $files[0]; return $filename; } This function fetches the files attached to the WP Download Manager post with get_package_data(). To get the path, this function assumes…

MemberPress Downloads add-on

The Downloads add-on for MemberPress adds downloadable files to MemberPress. These files are stored outside the Media Library, so by default Relevanssi attachment indexing has no access to them. However, Relevanssi offers filter hooks you can use to make Relevanssi index the MemberPress Downloads files. Adjust the query All this……to be changed, because the Downloads posts have the post type mdpl-file, status of publish and no MIME type. add_filter( ‘relevanssi_get_attachment_posts_query’, ‘rlv_mpdl_query’ ); /** * Filters the MySQL query for getting the attachments. * * Finds and replaces the ‘attachment’ post type restriction to look for mpdl-file * posts and……use the relevanssi_get_attached_file filter hook to modify the name and path of the file sent to Relevanssi: add_filter( ‘relevanssi_get_attached_file’, ‘rlv_mpdl_file’, 10, 2 ); /** * Filters the name and path of the file. * * Gets the file name from the _mpdl_file_filename custom field of the download file * post…

Download

The link to download the latest version of Relevanssi Premium appears below if you have an active subscription. If you don’t have one, register for an account here and follow the instructions. If you’re looking for the free version of Relevanssi, check the WordPress plugin repository….

relevanssi_disabled_shortcodes

…’woocommerce_edit_address’, ‘tc_process_payment’, ‘maxmegamenu’, // Max Mega Menu. ‘searchandfilter’, // Search and Filter. ‘downloads’, // Easy Digital Downloads. ‘download_history’, ‘purchase_history’, ‘download_checkout’, ‘purchase_link’, ‘download_cart’, ‘edd_profile_editor’, ‘edd_login’, ‘edd_register’, ‘swpm_protected’, // Simple Membership Partially Protected content. ‘gravityform’, // Gravity Forms. ‘sdm_latest_downloads’, // SDM Simple Download Monitor. ‘slimstat’, // Slimstat Analytics. ‘ninja_tables’, // Ninja Tables….

Premium 1.14.6 | Free 3.5.6

…Relevanssi didn’t highlight terms that were followed by a ?, ! or an apostrophe. There’s also a new filter hook relevanssi_ok_to_log that makes it easier to control query logging. The free version can be downloaded from the repository, Premium can be downloaded through automatic updates or from the download page….

ACF: Indexing File field title

…the trick: add_filter( ‘relevanssi_custom_field_value’, ‘rlv_file_name’, 10, 2 ); function rlv_file_name( $values, $field ) { if ( ‘download_section’ === $field ) { $values = array_map( function( $attachment_id ) { return get_the_title( $attachment_id ); }, $values ); } return $values; } Assuming the field name is download_section, this indexes the attachment title….I use the ACF field type File for a download section, but the displayed file title is not indexing. The format I return the ACF field data is “File Array (array)”. For Relevanssi, it doesn’t matter which ACF return format you choose. Relevanssi doesn’t use get_field() but instead uses the…

Premium 2.3.0 / Free 4.2.0

…better in multisite searching when you search for a taxonomy that doesn’t exist on the current site. Both versions are already out. Premium is available on the Download page and through the WordPress automatic updates, the free version can be downloaded from the plugin repository or with the automatic updates….…a search and you can then easily pin posts for that search term. New feature: Relevanssi can now use the contents of the PDF files indexed with WP File Download. New feature: Relevanssi now supports User Access Manager permission controls. Filters New filter: relevanssi_indexing_tokens can be used to filter the…

Known conflicts

…with some luck this will make Relevanssi and JetSmartFilters work together. Limited compatibility FooGallery – Relevanssi can index the images in the galleries, but the galleries themselves are inaccessible to Relevanssi. Has issues WP File Download – WP File Download overrides Relevanssi post type settings and sets the searched post……types to “post, page, wpfd_file”. That can be overridden with a relevanssi_modify_wp_query filter function. Relevanssi is compatible with WP File Download and can read PDF content indexed by WP File Download. The PDF content won’t show up in excerpts. Beaver Builder – Relevanssi cannot be used within Beaver builder modules,…

Popular searches

…On this site, I use the Relevanssi spam block tool to reduce the number of search spam. Thanks to that the top searches are not Chinese spam domains. Now the top 5 searches in the last 30 days are search, download, download/page, download/2/page, and download/2/2/page. Super interesting! Second, displaying the…