PHPackages                             humanmade/related-posts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. humanmade/related-posts

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

humanmade/related-posts
=======================

Extensible related posts wrapper with support for manual overrides.

1.2.2(7y ago)124.2k2[4 issues](https://github.com/humanmade/HM-Related-Posts/issues)[1 PRs](https://github.com/humanmade/HM-Related-Posts/pulls)GPL-3.0PHP

Since Nov 20Pushed 7y ago18 watchersCompare

[ Source](https://github.com/humanmade/HM-Related-Posts)[ Packagist](https://packagist.org/packages/humanmade/related-posts)[ RSS](/packages/humanmade-related-posts/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Related Posts
=============

[](#related-posts)

This plugin provides a simple related posts function with the following features:

- ElasticPress integration (uses a "More Like This" query)
- Admin UI for manually overriding related posts

Installation
------------

[](#installation)

```
composer require humanmade/related-posts

```

Usage
-----

[](#usage)

The plugin exposes a single function that returns a list of post IDs.

### `HM\Related_Posts\get( int $post_id, array $args = [] )`

[](#hmrelated_postsget-int-post_id-array-args---)

**$post\_id** is the ID of the post to get related content for.

**$args** allows you some control over the posts that are returned:

- int **limit**: defaults to `10`
- array **post\_types**: array of post types to limit results to. Defaults to `[ 'post' ]`
- array **taxonomies**: array of taxonomies to compare against. Defaults to `[ 'category' ]`
- array **terms**: array of `WP_Term` objects, results will match these terms
- array **terms\_not\_in**: array of `WP_Term` objects, results will not match these terms
- bool **ep\_integrate**: if true then ElasticPress is used to get the results, Defaults to `defined( 'EP_VERSION' )`

### Custom post type support

[](#custom-post-type-support)

To add related posts support to your custom post type simply declare the following:

`add_post_type_support( 'your-custom-post-type', 'hm-related-posts' );`

In addition to fine control the post types that have related posts support you can use the `hm_rp_post_types` filter.

```
add_filter( 'hm_rp_post_types', function ( $post_types ) {
    // your code goes in here

    return $post_types;
} );
```

---

Made with ❤️ by [Human Made](https://humanmade.com)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 59.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Total

5

Last Release

2670d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21655?v=4)[Ryan McCue](/maintainers/rmccue)[@rmccue](https://github.com/rmccue)

![](https://www.gravatar.com/avatar/77dbeefb7745010589603f2ffc6ff310d8f700b58e08d52af190744c43342526?d=identicon)[roborourke](/maintainers/roborourke)

![](https://www.gravatar.com/avatar/f1d0ffccdc5d339ff98a91e1b224a0d92f93dc8c2f772124473a76655b83129c?d=identicon)[joehoyle](/maintainers/joehoyle)

---

Top Contributors

[![mattheu](https://avatars.githubusercontent.com/u/494927?v=4)](https://github.com/mattheu "mattheu (44 commits)")[![roborourke](https://avatars.githubusercontent.com/u/23417?v=4)](https://github.com/roborourke "roborourke (19 commits)")[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (11 commits)")

### Embed Badge

![Health badge](/badges/humanmade-related-posts/health.svg)

```
[![Health](https://phpackages.com/badges/humanmade-related-posts/health.svg)](https://phpackages.com/packages/humanmade-related-posts)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
