Search Excerpt does not include Shortcode Results
-
I recently noticed that when I updated Relevanssi, the search results excepts were missing data. I have numerous download pages on my site which use a shortcode to pull the filenames from a folder and build hyperlinks on the page. In previous versions, using the expand shortcode option indexed all of these filenames and displayed the relevant ones in the search excerpt. However, in the newer version, the excerpt only displays the headers that are on the page but none of the shortcode information.
I have two filters for the plugin which are used to format the except to make it look like a list and have allowed <br> tags in the except. These are the filters:
add_filter( 'relevanssi_post_content', 'rlv_filesize' ); function rlv_filesize( $content ) { $content = preg_replace( '#<td class="filesize".*?</td>#', '', $content ); return $content; } add_filter( 'relevanssi_excerpt_content', 'rlv_excerpt', 10, 2 ); function rlv_excerpt( $content, $post ) { $content = preg_replace( '#<td class="filesize".*?</td>#', '<br />', $content ); return $content; }
I am not sure why it is not working and would appreciate your feedback. It may have to do with the new Gutenberg system.
The page I need help with: [log in to see the link]
- The topic ‘Search Excerpt does not include Shortcode Results’ is closed to new replies.