PHPackages                             humanmade/entity-base - 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/entity-base

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

humanmade/entity-base
=====================

Entity Base is a content analysis plugin that uses the TextRazor Natural Language Processor to extract entities from post content.

0.5.0(2mo ago)81.7k↓50%GPL-2.0-or-laterPHP

Since Nov 7Pushed 2mo ago11 watchersCompare

[ Source](https://github.com/humanmade/entity-base)[ Packagist](https://packagist.org/packages/humanmade/entity-base)[ RSS](/packages/humanmade-entity-base/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (11)Used By (0)

WordPress TextRazor Entity Base
===============================

[](#wordpress-textrazor-entity-base)

Entity Base is a content analysis plugin that uses the TextRazor Natural Language Processor to extract entities from post content.

Entities are stored in a new Entity post type, tagged with thier DBPedia and Freebase types. Individual posts associated with an entity store the relationship in its post meta.

Settings
--------

[](#settings)

The settings page can be found under the "Entities" section in the WordPress admin menu.

- **API Key**: Configure the API key for the TextRazor service. Free API keys are available from textrazor.com.
- **Entity Allowlist**: Entities that should always be included in the analysis, one per line.
- **Entity Blocklist**: Entities that should always be excluded from the analysis, one per line.
- **DBPedia Filters**: DBPedia types to include in the analysis, one per line.
- **Freebase Filters**: Freebase types to include in the analysis, one per line.
- **DBPedia Blocklist**: DBPedia types to exclude from the analysis, one per line.
- **Freebase Blocklist**: Freebase types to exclude from the analysis, one per line.
- **Minimum Confidence Score**: Set the minimum confidence score required for an entity to be considered valid.
- **Minimum Relevance Score**: Set the minimum relevance score required for an entity to be considered valid.

Processing content
------------------

[](#processing-content)

Individual posts are analysed on save. This includes saving as a draft, or publishing content.

Posts can be processed in bulk using WP CLI with the following command:

```
wp entity-base analyse
```

The following options are available:

- `posts_per_page`: Number of posts to analyse at a time. Default: `100`.
- `max_requests`: Total number of posts to analyse, `0` for all. Default: `100`.
- `post_types`: Comma separated list of all post types to process. Default: `post`.
- `post_id`: Single post ID to process.
- `initial_page`: Skip pages, useful to resume analysis. Default: `1`.

### Filtering

[](#filtering)

All entites are returned from TextRazor, then filtered during processing. Some of these entities do not have a DBPedia type or Freebase type; entities must match at least one allowed type to be considered valid.

### Caching

[](#caching)

The TextRazor response is stored as a transient for each post. The cache key is hashed using the data that is sent for processing, meaning any changes to content will require a fresh analysis from TextRazor.

Data relationships
------------------

[](#data-relationships)

When a post is analysed, the extracted entities are saved to the post's meta data with the following keys:

- `_entity_{entity_slug}`: Confidence score for each entity.
- `_entity_rel_{entity_slug}`: Relevance score for each entity.
- `_entities`: Array of all extracted entites and associated data from TextRazor.

The posts associated with an entity can be queried using a meta key EXISTS query. Or by using the utility function `EntityBase\Utils\query_connected_posts`.

Example code:

```
$connected_posts = EntityBase\Utils\query_connected_posts( $entity_post );

// Or

$connected_posts = new WP_Query( [
	'post_type' => 'any',
	'post_status' => 'publish',
	'meta_key' => mb_strcut( '_entity_' . $entity->post_name, 0, 256 ),
	'meta_compare' => 'EXISTS',
] );
```

When an entity is deleted, the confidence and relevance scores attached to posts are also deleted.

The connected post count is stored in the `comment_count` column of the entity so that you can query and order entities based on this value in a performant way.

To query for all entities attached to a post, you can use the utility function `get_entities_for_post` which will return the entities ordered by relevance score.

```
$entities = EntityBase\Utils\get_entities_for_post( WP_Post $post );
```

Exporting entities
------------------

[](#exporting-entities)

Entities can be exported through the WordPress admin or via WP CLI. The export contains individual URLs for posts associated with an entity. The number of URLs returned for each entitiy can be configured using the `max_urls` parameter.

A CSV export using default settings can be downloaded from the settings page.

Entities can be exported using WP CLI with the following command:

```
wp entity-base export
```

The following options are available:

- `format`: The data format to get results in, `json` or `csv`. Default: `json`.
- `max_urls`: Number of URLs/posts to return per entity. Default: `100`.
- `chunk_size`: Number of records to return per chunk. Default: `300`.

Available hooks
---------------

[](#available-hooks)

Filters

- `entitybase_allowed_post_types`: Specifiy which posts types to analyse on save.
- `entitybase_filter_post_content`: Modify post content before it is sent to TextRazor.

Actions

- `entitybase_entity_created`: Fires after a new Entity has been created.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance88

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.3% 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 ~124 days

Total

5

Last Release

61d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/494927?v=4)[Matthew Haines-Young](/maintainers/mattheu)[@mattheu](https://github.com/mattheu)

---

Top Contributors

[![mattheu](https://avatars.githubusercontent.com/u/494927?v=4)](https://github.com/mattheu "mattheu (25 commits)")[![maugelves](https://avatars.githubusercontent.com/u/2919706?v=4)](https://github.com/maugelves "maugelves (2 commits)")[![roborourke](https://avatars.githubusercontent.com/u/23417?v=4)](https://github.com/roborourke "roborourke (1 commits)")

### Embed Badge

![Health badge](/badges/humanmade-entity-base/health.svg)

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

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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