Related Posts

Since ElasticProbe processes and understands data in real time, it can quickly display related posts and contents without slowing down your site. This feature automatically shows visitors other content on your site that’s similar to what they’re currently viewing—based on things like categories, tags, or similar text—helping keep users engaged and encouraging them to explore more.

Enabling Related Posts in ElasticProbe Plugin

  • Log into your WordPress admin area (e.g., https://yourdomain.tld/wp-admin).
  • Locate ElasticProbe in your list of installed plugins from the sidebar and click on it.
  • Navigate to the Related Posts And Enable it.
  • Save Changes: Click Save Changes to apply your highlighting settings.
  • After enabling it, continue reading this document to learn how to add this feature to your site.

Adding Related Post Widget

  • Log into your WordPress admin area (e.g., https://yourdomain.tld/wp-admin).
  • Locate the Appearance in sidebar
  • Click on Widgets
  • Click on Block Inserter or Add block

  • Type related post to find the corresponding widget and select to add to your search result page.
  • You could select number of related items to show.
  • Click on Update button.

Using Related Posts API

Besides using the widget , you can also fetch these posts programmatically through the ElasticProbe API. Two available functions are:

  • find_related

Retrieves related posts based on a specific $post_id. This function can be integrated into your theme or plugin to display related content dynamically.

				
					
$related_posts_array = \ElasticProbe\Features::factory()
    ->get_registered_feature( 'related_posts' )
    ->find_related( $post_id, $return = 5 );
				
			
  • get_related_query

Retrieve a WP_Query object containing related posts based on a specific $post_id.

				
					
$related_posts_query = \ElasticProbe\Features::factory()
	->get_registered_feature( 'related_posts' )
	->get_related_query( $post_id, $return = 5 );