Excluding old content from the search
Is there a way to exclude anything before 2016 from search results? Yes. There are two approaches to this. If you never want to see anything old in the results, it’s best to filter in indexing with relevanssi_indexing_restriction. Add this to your site: add_filter( ‘relevanssi_indexing_restriction‘, ‘rlv_exclude_old_posts’ ); function rlv_exclude_old_posts( $restriction……news post type that are older than one year, you can use: add_filter( ‘relevanssi_indexing_restriction‘, ‘rlv_exclude_old_news’ ); function rlv_exclude_old_news( $restriction ) { $restriction[‘mysql’] .= ‘ AND ( ( post.post_date >= CURDATE() – INTERVAL 1 YEAR ‘ . ” AND post.post_type = ‘news’ ) OR ( post.post_type != ‘news’ ) ) “;…