Support » Plugin: Relevanssi - A Better Search » reindexing by cronjob

  • I have some trouble with reindexing of new posts. The reason is simple – i sync data into the db automaticly.

    So what i need is a cronjob to reindex the site once a day. How looks a cronjob?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari


    The easiest way would be to get Relevanssi Premium and use WP CLI, so you can just say wp relevanssi index to get the job done.

    If that’s not possible, you need to use the function relevanssi_build_index() to build the index. It’ll work fine, if your database is small enough so that you can index it in one go; if not, you need to run it several times, first with

    relevanssi_build_index(false, false, X);


    relevanssi_build_index(true, false, X);

    as many times as is necessary, where X is a number of posts you are guaranteed to be able to index at one go.

    Hei Mikko!

    Thanks for your response. I use Relevanssi Premium almost a view years. Do you have dokumentation aboutwp relevanssi index?


    I too would like to set up a cron job for indexing nightly (and have Relevanssi Premium)! But I am not familiar at all with setting up cron jobs, or command line.

    Is it possible using a plugin like this?


    Plugin Author Mikko Saari


    @markuszeeh See WP CLI documentation on

    @jacquid I would suggest you ask your hosting provider how to set this up. Ask if they offer WP CLI and if they can set it up so that wp relevanssi index runs every night. If they don’t offer WP CLI, tell them that they should, because it’s a great tool =)

    If they don’t have WP CLI, using that plugin is definitely an option and a fairly easy way to set this up. But you have to find out if your site is small enough to be indexed on one go, otherwise you’re going to bump into problems.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘reindexing by cronjob’ is closed to new replies.