Drupal is a registered trademark of Dries Buytaert
drupal 10.6.12 Update released for Drupal core (10.6.12)! drupal 11.3.13 Update released for Drupal core (11.3.13)! drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)!

content_like

No security coverage
View on drupal.org

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

Activity

Total releases
2
First release
Jun 2026
Latest release
12 hours ago
Release cadence
0 days
Stability
50% stable

Releases

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