Related Posts by Taxonomy 2.7.10 has 1 actions and 44 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
phpfunctions.phpyour child theme
// Run your own code when Related Posts by Taxonomy fires an action
add_action( 'related_posts_by_taxonomy_after_display', function( $type ) {
// Your code runs here.
}, 10, 1 );
// Change a value Related Posts by Taxonomy is about to use
add_filter( 'related_posts_by_taxonomy', function( $posts, $post_id, $taxonomies, $query_args ) {
// Change $posts here.
return $posts;
}, 10, 4 );
Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
/**
* Filter expiration time for the related posts query results in the WP object
* cache.
*/
apply_filters( 'related_posts_by_taxonomy_wp_object_cache_expiration', 0, 'posts' );
/**
* Filter placeholder HTML while loading posts with the lazy loading feature.
*/
apply_filters( 'related_posts_by_taxonomy_lazy_loading_html', '', $args );
/**
* Filter the GROUP BY clause of the related posts query.
*/
apply_filters_ref_array( 'related_posts_by_taxonomy_posts_groupby', array( $group_by_sql, $post_id, $taxonomies, $args ) );
/**
* Limit the related posts query by post meta query.
*/
apply_filters( 'related_posts_by_taxonomy_posts_meta_query', $meta_query, $post_id, $taxonomies, $args );
/**
* Filter the ORDER BY clause of the related posts query.
*/
apply_filters_ref_array( 'related_posts_by_taxonomy_posts_orderby', array( $order_by_sql, $post_id, $taxonomies, $args ) );
/**
* Filter the WHERE clause of the related posts query.
*/
apply_filters_ref_array( 'related_posts_by_taxonomy_posts_where', array( $where_sql, $post_id, $taxonomies, $args ) );
/**
* Filter the related post gallery image in the feed.
*/
apply_filters( 'related_posts_by_taxonomy_rss_post_thumbnail_link', $image_link, $related, $args );
/**
* Filters Disallowed tags (<scipt> etc...) out of html output by default.
*/
apply_filters( 'related_posts_by_taxonomy_strip_disallowed_html', true, $rpbt_args );