Title: Add like button to posts
Last modified: August 31, 2016

---

# Add like button to posts

 *  [loauy24](https://wordpress.org/support/users/loauy24/)
 * (@loauy24)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/add-like-button-to-posts/)
 * Hi everyone,
 * I want to know how to add like button on my posts.
 * The main idea is about create counter increased by one when someone clicked on
   like button.
 * I want to do this “programmatically” without use any plugin.
 * Can anybody help me? Thanks in advance

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/add-like-button-to-posts/#post-7267687)
 * For the best user experience, clicking the Like button should send an AJAX request
   to the server. The server side script can add the Like to a running total somewhere.
   Where depends on what is being liked. If a post, post meta is a good place.
 * Depending on how important it is to prevent voting fraud, the server side script
   should take some measure to prevent one person from liking the same thing multiple
   times. It’s probably impossible to fully protect against fraud, but requiring
   users to be logged in and keeping track of their likes in user meta would go 
   a long way.
 * Some folks have leveraged the comment system into a Like Button feature. I’m 
   not sure it’s worth doing so. If you write your own code then you know exactly
   what it’s doing. I assume that is in part why you do not want to use a plugin.
 * A nice touch would be to have javascript increment the count shown on the page(
   if there is a count) after the vote is registered server side. If nothing else,
   a brief modal thanking the user could be shown so they know their vote was registered.

Viewing 1 replies (of 1 total)

The topic ‘Add like button to posts’ is closed to new replies.

## Tags

 * [post](https://wordpress.org/support/topic-tag/post/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/add-like-button-to-posts/#post-7267687)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
