• Resolved moultrex

    (@moultrex)


    Hello.

    Relevanssi indexes our products but includes and the Draft ones.

    How can we make relevanssi index only published posts (products from woocommerce)?

    Thank you.

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

    (@msaari)

    Yes, Relevanssi indexes drafts (and private, pending, and future posts). In most cases it doesn’t really matter, though, as the search will only show published posts – you shouldn’t see any drafts in the search results. The drafts are only indexed for admin backend searches.

    If you know you never want to use Relevanssi search in the admin dashboard or that you never ever want to see drafts in search results, you can use this filter function in your theme functions.php to restrict the post statuses:

    add_filter( 'relevanssi_valid_status', 'rlv_restrict_status' );
    function rlv_restrict_status( $status ) {
        return array( 'publish', 'private' );
    }

    This would only allow posts are public or private, and would skip drafts, pending posts and scheduled posts.

    Thread Starter moultrex

    (@moultrex)

    Thank you very much. It works!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Index only Publish Status’ is closed to new replies.