Skip to content

WordPress Like Button Block: A Gutenberg Guide

6 min read

Add a like button block in WordPress with the free ULike Button and Top List blocks

If you write in the WordPress block editor, you can add a like button the same way you add a paragraph or an image: as a block. The free WP ULike plugin comes with two blocks, ULike Button and Top List, and it can also put a like button on every image in a Gallery block.

This guide shows how to use each one, with screenshots from a demo recipe site on WordPress 7.1. No code and no shortcodes.

The WordPress block inserter with ulike typed in the search box, showing the ULike Button and Top List blocks
Type “ulike” in the block inserter to find both blocks.

What you need

  • The free WP ULike plugin. Both blocks and the Gallery option are free.
  • WordPress 6.0 or newer with the block editor. It works with block themes like Twenty Twenty-Five and with classic themes.
  • Optional: WP ULike Pro for 25+ button templates, emoji reactions and dislike rankings.

Want a button on every post automatically, without adding a block each time? That is a setting, not a block. Our main guide on how to add a like button to WordPress covers it.

How to add the ULike Button block

  1. Open a post or page in the block editor.
  2. Click the + button and type “ulike” (or “like”) in the search box.
  3. Click ULike Button. The button appears where your cursor was.
  4. In the sidebar, pick a template, for example Heart.
  5. Click Save or Update.
The ULike Button block selected in the WordPress editor, with Custom Item ID set to 10 and the Heart template picked in the block settings
The ULike Button block settings: a custom item ID and the template picker.

The settings, in plain words

  • Item Type: Posts or Comments. Leave it on Posts unless the block sits inside a comment.
  • Use Current Item ID: on by default, so the button likes the post it is on.
  • Custom Item ID: turn off Use Current Item ID and enter a post ID to make the button like a different post. Handy on a landing page about one recipe or product. Note that votes on a custom ID are not shown in your statistics.
  • Select a Template: the button style. “Use Settings Default” follows your global WP ULike settings, so changing the style there updates every button. Pro templates show a lock until you have Pro.
  • Button Type: show the template’s icon or a text label, for templates that support text.

Use it in a Query Loop or comments

The block knows where it is. Put it inside a Query Loop’s post template and every post in the list gets its own button with its own count. In a block theme you can also add it to the Comment Template inside the Comments block, set Item Type to Comments, and every comment gets a like button.

How to show your most liked posts with Top List

The Top List block shows a ranked list of your most liked content. Add it the same way, then pick what to rank in the sidebar.

The Top List block selected in the WordPress editor showing five most liked recipes, with Type set to Top Posts, Status Filter Like, View By Descending and five items
The Top List block in the editor. Here it ranks recipes by likes.
  • Type: top posts, comments or users. Top activities and topics appear when BuddyPress or bbPress is active.
  • Status Filter: rank by likes. With Pro you can also rank by dislikes.
  • Number of items to show: how long the list is.
  • Period: all time, this week, this month, this year, the last X days, or your own date range.
  • Filters: only some post types, or posts from certain categories.
  • Customize: a heading, rank numbers, the like count, thumbnails or avatars and their size, and how long titles can be. Engaged Users adds the avatars of people who liked each item.

Colors, font size and spacing are in the block’s Styles tab, like any core block. Two Top Lists side by side in a Columns block make a nice “Reader favorites” section:

A WordPress page with two Top List blocks side by side, most loved recipes with thumbnails and top fans with avatars, and a heart like button with 87 likes below
Two Top List blocks in Columns, and a ULike Button for one recipe. This is the live page, not the editor.

Add a like button to every image in a gallery

This one isn’t a separate block. Select any Gallery block, open the WP ULike panel in the block settings and turn on Show a like button on each image. Each image gets its own button and its own count, so visitors can like the photo they love, not just the post.

A Gallery block selected in the WordPress editor with the WP ULike panel open and Show a like button on each image turned on
The WP ULike panel in the Gallery block settings.

It is off by default, so galleries you already published don’t change until you turn it on.

Blocks, shortcodes or automatic display?

You wantUse
A button on every post, page or productAutomatic display in the WP ULike settings
A button in one specific spotThe ULike Button block
A “most liked” list on a page or in a sidebarThe Top List block
Likes on gallery photosThe Gallery block’s WP ULike option
A page built with ElementorThe WP ULike Pro Elementor widgets
A theme file or a page builder without blocksThe [wp_ulike] and [wp_ulike_top] shortcodes (shortcode guide)

If something doesn’t look right

  • You see two buttons on a post. Automatic display already adds one. Remove the block, or turn off automatic display for that content type.
  • The button likes the wrong post. Check Use Current Item ID. On a landing page, turn it off and enter the right post ID.
  • Top List is empty. The period may be too short for your site. Try “All time” first.
  • A template has a lock. That style is part of Pro. Pick one of the free ones, or see all templates.

Still stuck? Contact support and we’ll help.

Frequently asked questions

Is the WP ULike like button block free?

Yes. The ULike Button block, the Top List block and the Gallery option are all in the free WP ULike plugin. Pro adds more button templates and dislike rankings.

How do I add a like button in Gutenberg?

Install WP ULike, open a post in the block editor, click +, search for “ulike” and add the ULike Button block. Pick a template in the sidebar and save.

Can I show the most liked posts in the block editor?

Yes. Add the Top List block and set Type to Top Posts. You can choose the period, the number of posts, a category and whether to show thumbnails.

Does the block work in Full Site Editing templates?

Yes. You can add the ULike Button block to templates and to a Query Loop. Each post in the loop gets its own button.

Can visitors like single images?

Yes. Turn on Show a like button on each image in a Gallery block’s WP ULike panel. Each image keeps its own count.

Will adding the block create a second button?

It can, if automatic display is also on for that content type. Use one or the other on the same post.

Get WP ULike free · Browse templates · See Pro plans

Enjoyed this article?

Get more WordPress tips like this in our monthly newsletter: updates, guides, and product news.

Leave a Reply

Your email address will not be published. Required fields are marked *