Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Simple Like Button

31 sites Security covered Drupal 10–11
View on drupal.org

This module provides a simple AJAX-powered "Like" button for Drupal content, allowing authenticated users to instantly like or unlike entities and see a running total of likes. It also displays the names of users who have liked the content, but it is not compatible with Views and is not visible to anonymous users.

Simple Like Button

A very simple like button for Drupal. Provides an AJAX-powered "Like" button that shows instant feedback and a running count of likes on content.

Features

  • Instant feedback for end users: increments/decrements like count (+1 / -1).
  • Displays the names of users who liked the content.
  • Works with all entities and bundles (e.g., nodes).
  • Supports all authenticated roles.
  • Not available to anonymous users.
  • Not compatible with Views at the moment.
  • Also embedded in the OpenLucius Drupal distribution.

Requirements

  • Drupal 10 or 11
  • PHP version supported by your Drupal core.
  • Authenticated users (the button is not rendered for anonymous users).

Installation

  1. Enable the module

    • UI: Admin -> Extend (admin/modules)
    • Drush: drush en simple_like_button -y
  2. Place the block

    • UI: Admin -> Structure -> Block layout (admin/structure/block)
    • Place Simple Like Button in a region on the page that displays your entity content, e.g. -> Content region under the main content.
  3. Done! The like button should now appear for authenticated users on pages that show an entity (e.g., nodes).

Permissions

No special configuration is usually required beyond having an authenticated user. The button is intentionally hidden for anonymous users.

How it works

  • Renders a like form (form#like-form) with a button for authenticated users.
  • Tracks and updates a per-entity like count via AJAX submit.
  • Button toggles between "Like" and "Liked" depending on the current user state for that entity.
  • Shows a list of user display names who liked the entity.

Theming & Markup

  • Form ID: like_form (HTML id like-form).
  • A standard is used for submitting/undoing the like.
  • You can target the block region or form ID with CSS to customize layout.

Tip: If your theme hides block titles by default, ensure the block's title settings are appropriate for your layout.

Caching

The block/form is user-specific. Drupal automatically bypasses caching for POST requests. If you are using additional reverse proxies or aggressive caching, ensure authenticated traffic is handled correctly so that the form can submit and the like state can update.

Limitations

  • Not currently compatible with Views.
  • Not displayed for anonymous users.

Automated Test

This module ships with a Functional test that validates the basics:

  • Installs simple_like_button and dependencies
  • Creates a node and sets it as the <front>page
  • Places the Simple Like Button block in the default theme content region
  • Visits <front> as an authenticated user and asserts the like form/button is visible

Troubleshooting

  • Button not showing? Confirm you're viewing an entity route (e.g., a node canonical page), you're logged in, and the block is placed in a visible region.
  • AJAX not updating? Check your browser console, ensure CSRF and session cookies are present, and verify that reverse proxy caches are not interfering.
  • Multiple Like blocks? If you place multiple blocks, make sure they appear on pages that can resolve the current entity; otherwise the block may render without a target entity.

Maintainers

  • Project maintainer: Joseph Olstad
  • Formerly Joris Snoek

Please report issues or feature requests on the module's issue queue on Drupal.org (project page) https://drupal.org/project/simple_like_button .

License

GPL-2.0-or-later (same license as Drupal).

Optional config

Optionally you can configure the block to include/exclude certain pages or sections:

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Oct 2025
Latest release
10 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
1.0.0 Stable 10–11 Oct 16, 2025