Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Leaflet 10.4.13 — Minor update available for module leaflet (10.4.13). Release: Flag 5.1.1 — Minor update available for module flag (5.1.1). Release: MCP Sentinel 2.33.0 — Minor update available for module mcp_sentinel (2.33.0). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Content Like

1 sites No security coverage Drupal 10–11
View on drupal.org

This module adds a simple AJAX-powered like/unlike feature to content and custom blocks. It tracks likes from both logged-in users and anonymous visitors using cookies, preventing duplicates and allowing administrators to configure where the feature is enabled.

Content Like

Content Like provides a simple AJAX like/unlike feature for Drupal content.
It supports both authenticated users and anonymous visitors.

Features

  • AJAX like/unlike functionality
  • Like count display
  • Supports nodes and custom block content
  • Authenticated users are tracked by Drupal user ID
  • Anonymous users are tracked using a browser cookie
  • Prevents duplicate likes using a database unique key
  • Admin configuration for enabled content types and custom block types
  • Works with default Drupal Twig templates
  • Supports custom Twig templates
  • Lazy builder rendering to reduce cache-related liked-state issues

Configuration

After enabling the module, go to:

/admin/config/content/content-like

From this settings page, site administrators can select which content types
and custom block types should have the like feature enabled.

If a bundle is checked, the like widget is shown when that entity is rendered.
If a bundle is unchecked, the like widget is not shown.

How Authenticated Likes Work

For logged-in users, the module stores the Drupal user ID with the liked entity.
This prevents the same user from repeatedly liking the same content.

How Anonymous Likes Work

For anonymous visitors, the module creates a browser cookie named
content_like_anon_id. The raw cookie value is not stored directly
in the database. Instead, the module stores a hash of the anonymous ID.

This allows anonymous visitors to like and unlike content while reducing
repeated likes from the same browser.

Duplicate Prevention

The module stores likes in a custom database table and uses a unique key on:

  • Entity type
  • Entity ID
  • Liker type
  • Liker ID

This prevents duplicate likes for the same content by the same authenticated
user or anonymous cookie visitor.

Twig Usage

If your theme prints the normal content render array, the like widget appears
automatically:

{{ content }}

If your theme manually prints fields in a custom Twig template, print the
like widget manually:

{% if content.content_like is defined %}
  {{ content.content_like }}
{% endif %}

Requirements

  • Drupal 10 or Drupal 11
  • Node module
  • Block Content module

Permissions

The module provides the following permission:

Administer content like settings

Users with this permission can configure where the like feature is enabled.

Typical Use Cases

  • Blog post likes
  • Article likes
  • Custom block likes
  • Public content engagement tracking

Depends on

Dependencies of the latest stable release

  • block_content Drupal core
  • node Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jun 2026
Latest release
3 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
1.0.0 Stable 10–11 Jun 23, 2026
1.0.x-dev Dev 10–11 Jun 23, 2026