Database Schema
BuddyPress Reactions overviewPremiumGet BuddyPress Reactions →
The plugin creates three tables on activation. All table names use the WordPress table prefix (default wp_).
{prefix}bp_reactions_emojis
Section titled “{prefix}bp_reactions_emojis”Stores the available emoji library.
| Column | Type | Description |
|---|---|---|
id |
int AUTO_INCREMENT |
Primary key |
name |
varchar(500) |
Display label (editable on the Manage Emojis tab) |
type |
enum('inbuilt','custom') |
Whether the emoji is built-in or user-created |
format |
varchar(10) |
Rendering format, seeded as svg/json |
On activation the plugin populates this table with 204 built-in emojis. SVG files live in the plugin’s emojis/svg/ directory and Lottie JSON in emojis/json/, referenced by ID.
{prefix}bp_reactions_shortcodes
Section titled “{prefix}bp_reactions_shortcodes”Stores named reaction-set configurations.
| Column | Type | Description |
|---|---|---|
id |
bigint AUTO_INCREMENT |
Primary key |
name |
varchar(255) |
Human-readable name (e.g. “Activity Reaction”) |
post_type |
varchar(255) |
Associated content type (may be empty for BuddyPress activity sets) |
front_render |
boolean (default true) |
1 if this set renders on the front end |
options |
text |
JSON blob of configuration options |
The options JSON can contain: emojis (array of emoji IDs), shortcode_name (string), post_type (string), auto_append ("1"/"0"), and animation ("true"/"false").
On activation the plugin seeds these sets. IDs are assigned by insertion order and are not fixed API values - look them up on your install rather than hard-coding them:
| Name | post_type |
|---|---|
{Posts label} Reaction |
post |
| Activity Reaction | (empty) |
| Activity Comment Reaction | (empty) |
| bbPress Topic Reactions | topic |
| bbPress Reply Reactions | reply |
{prefix}bp_reactions_reacted_emoji
Section titled “{prefix}bp_reactions_reacted_emoji”Records each individual reaction by a member.
| Column | Type | Description |
|---|---|---|
id |
bigint AUTO_INCREMENT |
Primary key |
user_id |
bigint(20) |
WordPress user ID of the member who reacted |
post_id |
bigint(20) |
ID of the content item reacted to |
post_type |
varchar(50) |
Content type (activity, activity-comment, post, topic, reply) |
reacted_to |
varchar(10) |
Reaction target marker recorded with each reaction |
emoji_id |
int |
FK to bp_reactions_emojis.id |
bprs_id |
bigint(20) |
FK to bp_reactions_shortcodes.id |
reacted_date |
datetime |
Timestamp of the reaction (used by widget time-period filters) |
Indexes (added in v2.4.0 for scale):
idx_user_poston (user_id,post_id,bprs_id)idx_post_typeon (post_id,post_type,bprs_id)idx_emoji_statson (emoji_id,bprs_id)idx_reacted_dateon (reacted_date)
One row per member per content item per reaction set. Changing a reaction overwrites emoji_id on the existing row; removing it deletes the row.
Querying reaction counts
Section titled “Querying reaction counts”global $wpdb;
// Total reactions on one activity post for a given reaction set.$count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}bp_reactions_reacted_emoji WHERE post_id = %d AND post_type = %s AND bprs_id = %d", $activity_id, 'activity', $bprs_id) );Data cleanup
Section titled “Data cleanup”If Delete all data on uninstall is enabled on the Settings tab, the uninstall routine drops all three tables and deletes plugin options. This is irreversible. When it is off, all data is preserved after uninstall.
Related pages
Section titled “Related pages”- Hooks and Filters -
bp_reactions_after_reactfires after each row is inserted or updated - Reactions Log - admin UI for browsing
bp_reactions_reacted_emoji

