Alejandro Rioja.
Scripts

How to Cancel All Pending Friend Requests on Facebook (2026 Script)

Alejandro Rioja
Alejandro Rioja
5 min read
TL;DR

Visit m.facebook.com/friends/center/requests/outgoing, scroll to the bottom to load all pending requests, then run a short console script — but first inspect the 'Cancel Request' button to grab the current CSS class, because Facebook's auto-generated class names change and the old ones in most guides are stale.

Free newsletter

Every Wednesday. 28,400+ operators. Zero fluff.

Table of contents

Open Table of contents

The honest caveat about the script

Every tutorial on this topic (including my older version) includes hardcoded CSS class names like _54k8 _52jg _56bs. Those are Facebook’s auto-generated obfuscated classes. They change whenever Facebook deploys a UI update — which happens constantly. If you paste the old class names into your console and nothing happens, that’s why.

The fix is simple: before running any script, spend 30 seconds finding the current class yourself.


Step 1 — Open the outgoing requests page and scroll to the bottom

Go to this URL in your browser (desktop or laptop):

https://m.facebook.com/friends/center/requests/outgoing/

This is the mobile Facebook site served in a desktop browser. It loads requests in batches, so scroll all the way to the bottom before running any script. If you skip this, the script only hits the requests currently loaded in the DOM.

Step 2 — Find the current “Cancel Request” CSS class

  1. Right-click on any “Cancel Request” or “Friend Request Sent” button on the page.
  2. Select Inspect (Chrome / Firefox / Edge all have this).
  3. Look at the class="..." attribute on that button element. It will be a string of several short tokens, something like _54k8 _52jg _xyz1 _abc2.
  4. Copy that entire class string.

cancel all friend requests on Facebook

Step 3 — Open the console

Press Alt+Cmd+J (Mac) or Ctrl+Shift+J (Windows/Linux) in Chrome to open the DevTools console, or right-click anywhere on the page → InspectConsole tab.

Step 4 — Paste the script with your current class string

Replace YOUR_CLASS_STRING_HERE with the class string you copied in Step 2:

javascript
var inputs = document.getElementsByClassName('YOUR_CLASS_STRING_HERE');
for (var i = 0; i < inputs.length; i++) {
  inputs[i].click();
}

For example, if the class you found was _54k8 _52jg _56bs _26vk, you’d run:

javascript
var inputs = document.getElementsByClassName('_54k8 _52jg _56bs _26vk');
for (var i = 0; i < inputs.length; i++) {
  inputs[i].click();
}

Hit Enter. The script iterates over every button matching that class and clicks each one. You’ll see the requests disappear from the list.

If nothing happens: the class string is still wrong. Go back to Step 2 and inspect the button again — sometimes there are nested elements; make sure you’re looking at the outermost button tag, not a span inside it.


Manual method (reliable, just slower)

If you only have a handful of requests to cancel, or the script isn’t cooperating:

  1. Go to https://www.facebook.com/friends/requests/?outgoing=1
  2. Hover over the Friend Request Sent button next to the person.
  3. Select Cancel Request, then confirm.

This always works regardless of class name changes.


Why I still care about Facebook friend requests in 2026

Outreach hygiene matters. A large backlog of unanswered sent requests can flag your account as spammy, which Meta’s systems pick up on. Cleaning out old stale requests — especially ones sent to people who clearly aren’t going to accept — is a basic account-health step if you’re actively using Facebook for networking.

I do most of my outreach via LinkedIn and direct email now, but Facebook groups in certain niches (operators, agency owners, local communities) still have no real replacement.


Canceling Facebook Friend Requests in 2026 — FAQ

Why doesn’t the old script with _54k8 _52jg work anymore?

Facebook uses auto-generated, obfuscated CSS class names that get regenerated when they push UI updates. The specific class string from any tutorial more than a few months old is almost certainly stale. The method itself (JavaScript console + getElementsByClassName) still works fine — you just need the current class name, which you can always find by inspecting the button.

Does this work on mobile (iOS / Android)?

No. The console-script approach requires a desktop browser’s developer tools. On mobile, you’re limited to the manual method: go to your sent requests, tap each one, and cancel individually. On iOS Safari you can technically enable developer tools via Settings → Safari → Advanced, but it’s cumbersome enough that a laptop is the practical choice.

Will Facebook ban or restrict my account for using this script?

I’ve never had an issue, and neither have the people I know who’ve used it. The script just simulates clicks — it’s not hitting any private API or doing anything the UI doesn’t already allow. That said, if you’re canceling thousands of requests in rapid succession, there’s some theoretical rate-limit risk. For most people with a few hundred stale requests, it’s a non-issue.

Is there an official Facebook tool to bulk-cancel sent requests?

Not as of 2026. Facebook’s native UI lets you cancel requests one at a time. The mobile site (m.facebook.com) groups them in one place, which is why we use it — but there’s no “cancel all” button. This script fills that gap.

Related reading:


This guide is part of alejandrorioja.com — written by Alejandro Rioja, who now builds AI agent systems for founders. Including the agent that keeps this site current. How it works →

Updated for May 2026

A few things have shifted since this post first went up. Meta dropped the legacy “Page” verification track in 2024 and folded it into Meta Verified ($14.99–$19.99/mo depending on tier and country) — the blue check is now a subscription, not a one-time review. Friend-request flows still work as described, though Meta moved the bulk-cancel UI deeper into mobile settings; the desktop m.facebook.com/friends/center/requests/outgoing route still works (2026-04 spot check).

Worth knowing in 2026: ~3.07B Facebook MAU (Meta Q4 2025 earnings), but the share of time-on-platform relative to Reels and WhatsApp has continued sliding. If this post is part of an outreach strategy, weight WhatsApp and Threads (yes — Threads survived the 2024 pivot speculation and crossed 200M MAU) accordingly.

Keep reading

Get the AI playbook in your inbox

Every Wednesday. 28,400+ operators. Zero fluff.

↵ to see all results esc esc to close