This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Duplicate results after search

#41676
Ernest MarcinkoErnest Marcinko
Keymaster

Sure, we can try something.

Make sure to have the plugin updated to the latest version, then try this custom code:

add_action('wp_footer', 'asp_custom_footer_script', 99999);
function asp_custom_footer_script() {
	?>
	<script>
	(function($){
		$('.asp_m').on('asp_elementor_results', function(){
			let id = $(this).data('id');
			let seen = [];
			$('.asp_es_' + id + ' .elementor-post').each(function(){
				if ( seen.includes(this.className) ) {
					$(this).remove();
				} else {
					seen.push(this.className);
				}
			});
		});
	}(WPD.dom));
	</script>
	<?php
}

If all goes well, this will detect duplicates and remove them before they are displayed.