Skip to main contentSkip to footer

EmbedPress has an auto-embed feature that tries to embed all URLs found in posts. This can cause problems with Relevanssi: searches can take a very long time when EmbedPress tries to fetch all outside URLs.

The solution is simple: you can disable this feature during Relevanssi excerpt creation. Add this snippet to your site:

add_action( 'relevanssi_pre_the_content', function() {
  remove_filter('the_content', ['\\EmbedPress\\Ends\\Front\\Handler', 'autoEmbedUrls']);
} );

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Indexing image alt texts
Relevanssi by default ignores image alt texts (and other tag attributes). That’s often the right thing to do because alt…
Changing the number of search results displayed

A standard way to change the number of search results displayed is something like this: $myquery = “&posts_per_page=5”; $myquery = $query_string.$myquery; query_posts( $myquery ); Unfortunately, this breaks Relevanssi. Relevanssi hasn’t played nice with posts_per_page in any case, for some reason I don’t really understand — this is legacy code from…

Indexing image captions for the posts

…can index it. The image captions for the images in the Media library is stored in the post excerpt, so what needs to be done is to fetch the post excerpts and include them. The actual filter is straightforward: add_filter( ‘relevanssi_content_to_index’, ‘rlv_add_attachment_excerpts’, 10, 2 ); /** * Indexes attachment excerpts……If you want to index the image captions for the posts where the images are used, that’s easy if the captions appear on the page: Relevanssi will index those captions as well as the other text from the post. However, if the captions don’t appear on the page, you need……extra steps in order to read in the captions. The trick is to add an indexing filter on the relevanssi_content_to_index filter hook that will find all the attachments for a post, fetch the desired data out of the attachments and add that data to the parent post content so Relevanssi…

Related Posts:

Comment Section:

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed