Skip to main contentSkip to footer

If Relevanssi Premium causes out-of-memory problems, make sure you have the “Throttle searches” option checked.

However, if that doesn’t work and you’re still getting out of memory issues, you can try making the throttle tighter. The limit can be adjusted by adding this line to your site:

add_filter( 'pre_option_relevanssi_throttle_limit', function( $limit ) { return 250; } );

If necessary, you can adjust the value (250) to a lower number. Anything over 100 should be safe.

Throttle and termless searches

The throttle is always on when there’s no search term involved in the search. Otherwise, the search would return all posts on the site as a result. That’s too much. If you, for some reason, want to disable the throttle completely in all cases, you can use this line:

remove_filter( 'relevanssi_query_filter', 'relevanssi_limit_filter' );

Your account

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

Search

Popular Resources

WP Job Manager

Relevanssi doesn’t work with the WP Job Manager search. The solution is fortunately simple: you can just disable Relevanssi for the WP Job Manager page. To disable Relevanssi, add this to your site: add_action( ‘get_job_listings_init’, ‘relevanssi_fix_for_wp_job_manager’ ); function relevanssi_fix_for_wp_job_manager(){ remove_filter( ‘posts_request’, ‘relevanssi_prevent_default_request’ ); remove_filter( ‘the_posts’, ‘relevanssi_query’ ); } Thanks to…

Effect of Relevanssi on page speed

…So, if having a big Relevanssi table slows down the site, the effect should definitely be visible on this site. I ran three tests using a speed test tool provided by my hosting provider Seravo (one of the best WP hosting companies in the world, by the way). It’s basically……accessed at all except during searching, so it shouldn’t matter how big the table is. Fortunately site speed is something that can be measured, so we can make some actual experiments here. The experiment I used Kirjavinkit as the testing ground, because it’s one of the biggest sites I run….

Spam search blocking

…infinite crawling spaces, they’re often low quality and often lead to empty pages. Search engines have limited time for crawling your site. You want them crawling your actual pages instead of low-quality search results pages. This also makes sense for performance purposes. On a site I own, there were 20,000……results You can also use Relevanssi spam blocking to block bots from search results pages. This can be useful: search engine bots can hit your site search a lot, with little benefit. According to Google’s John Muller, Google doesn’t want your internal site search pages in the index. They create……search queries in the server access log. Bing bot made about 16,000 of these. That’s a ton of wasted server power and a lot of unnecessary traffic. It’s a good idea to tell bots not to access your search results pages. To instruct bots to avoid your search results pages,…

Related Posts:

Comment Section:

7 Comments. Leave new

  • Simon Browning
    December 3, 2021 7:29 am

    For what its worth, this is our index state:

    10670 documents in the index.
    0 users in the index.
    0 taxonomy terms in the index.

    613260 terms in the index.
    2 is the lowest post ID indexed.

    Reply
  • Simon Browning
    December 3, 2021 12:53 am

    Hey there.

    We’re running out of memory when searching.

    I tried:
    add_filter( ‘pre_option_relevanssi_throttle_limit’, function( $limit ) { return 250; } );

    but that gives me:

    Parse error: syntax error, unexpected ‘250’ (T_LNUMBER) in /home/otsnew/public_html/wp-content/themes/Divi-child/functions.php on line 3

    Does this line need to be revised?

    Thank kyou

    Simon

    Reply
    • It’s correct. Make sure all spaces in there are spaces and not shift-spaces.

      Reply
      • Simon Browning
        December 3, 2021 3:30 pm

        Thank you for that.

        I disabled Relevanssi and found that yes, we still have the issue with searches.

        I tracked the issue down to ocurring when we have Ultimate Member enabled. We have member only content on the site, are there any known issues or conflicts with searches and Ultimate Member (I realize its not a Relevanssi issue now, just wondering if it has come up before).

        Simon

        Reply
      • Simon Browning
        December 3, 2021 7:26 am

        Thanks, that fixed it. I went through deleting and recreating the spaces. Strange though, I used the copy function on the web page.

        Still running out of memory though. I even set the throttle down to 10. Is there anything else it could be?

        Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /home/otsnew/public_html/wp-includes/post.php on line 2516

        Reply
        • (There was a shift-space in the sample code. I’ve removed it now.)

          Relevanssi in general isn’t very memory intensive. Even on a larger site, the Relevanssi search memory requirements are measured in tens of megabytes. If you’re running out of a gigabyte of memory, there are some larger issues on your site. I’d investigate what is taking up all that memory. It’s not Relevanssi.

          One thing you can do in Relevanssi is to disable custom excerpts if you’re using them.

          Reply

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