Thursday, September 4, 2025
HomeLanguagesJavascriptHow to auto like all the comments on a facebook post using...

How to auto like all the comments on a facebook post using JavaScript ?

In this article, we are going to learn how to like all the comments on a Facebook post automatically. Many times we want to like all the comments of friends on our post or on any other’s post, so this script helps us to save time and effort by automatically liking all the comments on the post.

Approach:

  1. Make variable comments that points to an array of all the comment on the post.
  2. Run a loop to iterate all the comments.
  3. Now we check if the comment is not already liked.
  4. Then click on the like button of that comment.

Below are the steps:

  • Go to the Facebook page using m.facebook.com
  • Sign in and open any post.
  • Open developer mode in Chrome by pressing Ctrl+Shift+I
  • Navigate to the console.
  • Now, run the below script. 

javascript




var comments =document.getElementsByClassName("touchable _2b0a");
for(var i=0;i<comments.length;i++)
{
    if(comments[i].style.color != "rgb(32, 120, 244)")
    {
        comments[i].click();
    }
}


Output:

Output

Note: Please ensure that there is a stable internet connection available so that the script runs smoothly. Also ensure to visit Facebook with m.facebook.com, not www.facebook.com because this script works on the mobile version of Facebook only.

Note: This tutorial is for educational purposes only, please don’t use it for disturbing anyone or in any unethical way.

RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6632 POSTS0 COMMENTS
Nicole Veronica
11800 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11860 POSTS0 COMMENTS
Shaida Kate Naidoo
6749 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6698 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS